Dataport - updating fields

fredrikreefredrikree Member Posts: 7
I'm trying to update a customer record via a dataport that imports files with only three fields.

Those fields are updated, but all other fields are emptied/defaulted.

AutoSave, AutoUpdate and AutoReplace properties of the dataport are all 'No', though I have tested changing them to 'Yes'.

I want the other fields in the record to stay as the are - how do I do that?

Regards,
Fredrik

Comments

  • chen_wanchen_wan Member Posts: 34
    Try to set the AutoSave and AutoUpdate to Yes but AutoReplace to No. Please make sure that the 3 fields that you import contains the primary key on the table.
  • fredrikreefredrikree Member Posts: 7
    "No." is a primary key, isn't it? And it's in the import. I tried the advice regarding AutoUpdate etc, but no change...
  • kinekine Member Posts: 12,562
    Throw out automatic processes of the dataport. Read the data into variables, and do it through code - it is simple:
      Customer.GET(No);
      Customer.VALIDATE(Field1,FIeld1Value);
    ...
      Customer.MODIFY;
    

    No and Field1Value etc. are global variables read in dataport...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • fredrikreefredrikree Member Posts: 7
    Thank you!

    I also found out, I missed the Customer.GET statement (used Customer.INIT instead, which probably caused the undesired result)
Sign In or Register to comment.