Import data (dataport)

LBinDENMARKLBinDENMARK Member Posts: 33
Hi alll. I'm new in Navision, but i will try to import some data to the customer table. I have a TAB file with Customer.no and an mail adress. How can i import the mail adress only. Some of the mail 'fields' in tab file is empty.
I have tryed to make an dataport, but it dublicates some of the mail adress and it don't fit whit the customer.no

Regards

CLEAR maked the trick

Answers

  • krikikriki Member, Moderator Posts: 9,118
    Properties of the dataitem:
    AutoSave=No
    AutoUpdate=No
    AutoReplace=No

    Create a global record (=recCustomer) for customer-table.

    In "OnBeforeImportRecord()" : clear all dataport-fields (in your case I think CLEAR(Customer); will do because you probably have Customer as dataitem and use some of its fields as dataport-fields). You need to do that because if in an imported line, a field is blank, it retains the value of previous imported line!
    In "OnAfterImportRecord()" (I suppose you use "Customer" as dataport-item)
    IF recCustomer.GET(Customer."No.") THEN BEGIN
      recCustomer."E-Mail" := Customer."E-Mail";
      recCustomer.MODIFY(TRUE);
    END;
    
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.