Dataport: Importing new contacts

NoelineNoeline Member Posts: 54
Is is possible for the the "No." field to automatically be populated/updated from the number series within Navision during an import of new records? Or does it have to exist in the import file?

Regards - Noeline

Comments

  • krikikriki Member, Moderator Posts: 9,118
    You can do it automatically.
    In the OnBeforeImport-trigger you must do a CLEAR of the record.
    In the OnAfterImport-trigger, do a INSERT(TRUE) of the record.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • NoelineNoeline Member Posts: 54
    Must be doing something wrong but it just would not work. :oops: I eventually inserted some code that is not very robust, doesn't check date ranges etc, but at least created the contact no's as required for this particular purpose.


    RMsetup.GET;
    NoSeriesLine.GET(RMsetup."Contact Nos.",10000);
    NewNo:=NoSeriesLine."Last No. Used";
    Contact."No.":=NoSeriesLine."Last No. Used";
    NoSeriesLine."Last No. Used" := INCSTR(NewNo);
    NoSeriesLine.MODIFY;
  • NoelineNoeline Member Posts: 54
    THANKS!!!

    According to the link this is what must be done ...
    "No." := ''; 
    INSERT(TRUE);
    
    It works!
    
  • SavatageSavatage Member Posts: 7,142
    In the OnAfterImport-trigger, do a INSERT(TRUE) of the record.
    but that's what Kriki said earlier :D
  • krikikriki Member, Moderator Posts: 9,118
    Savatage wrote:
    In the OnAfterImport-trigger, do a INSERT(TRUE) of the record.
    but that's what Kriki said earlier :D
    Probably it was late, and he was already sleeping (or early and still sleeping). :lol:
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • NoelineNoeline Member Posts: 54
    I suspect my input file was the problem the first time round. But I learn't one heck of a lot from it all. :D

    Thanks for the help.
Sign In or Register to comment.