Import data problem

swee-kengswee-keng Member Posts: 6
Hi all!

I want to import data from external file (.csv) to G/L Account table. If the search name is empty, I want to save the record equal to name, so I write such code in OnAferImportRecord trigger:

Code:
IF SearchVar = '' THEN BEGIN
"Search Name":=Name;
END ELSE BEGIN
"Search Name":=SearchVar;
END;

It seems ok, but when I run my dataport error occured:
"The field cannot be empty. Please enter a value".

I even try the same code in OnBeforeImportRecord, but nothing changed.
I try to turn off AutoUpdate and AutoSave on the properties and save the record through C/AL code (add line with Insert or Modify as needed), but still same.

Any idea?

Best regards!!!

Comments

  • swee-kengswee-keng Member Posts: 6
    The problem is solve, cause the dataport items not merge with columns on the external file (.csv). :D
Sign In or Register to comment.