web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Import excel.csv into Dynamics Nav 2017

(0) ShareShare
ReportReport
Posted on by

It was successful imported as a message box but the field was not. What should I do. Thankz

*This post is locked for comments

I have the same question (0)
  • Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    Without see the code (or what you’ve done) it’s difficult to help you...

  • keoma Profile Picture
    32,729 on at

    please describe more details.

  • Community Member Profile Picture
    on at

    I have a xmlport called Import contact list. Contains Salutation Code, FirstName,MiddleName,Surname, Address, City, MobilePhoneNo, Email,SalesPersonCode.
    It keeps importing duplicate after double click.

    code
    OnPostXMLport()

    MESSAGE ('Contact(s) importations successful');

    Contact - Import: :OnBeforeInsertRecord()

    employerrec .RESET;
    IF employerrec .GET(Contact."Company No.")= FALSE
    THEN ERROR ('Invalid Employer code for ' + Contact.Surname +' ' + Contact."First Name" +' '+ Contact."Middle Name" );
    Contact."Company Name":=employerrec."Company Name PenCom";

  • Community Member Profile Picture
    on at

    Please check the right question below. Thanks

  • Verified answer
    keoma Profile Picture
    32,729 on at

    a check if the contact already exists is missing.

    you can use following:

    // the xmlport

    Node Name Prefix Node Type Source Type Data Source

    Root Element Text <Root>

    Contact Element Table <Contact>(Contact)

    SalCode Element Field Contact::Salutation Code

    FirstName Element Field Contact::First Name

    MiddleName Element Field Contact::Middle Name

    Surname Element Field Contact::Surname

    Address Element Field Contact::Address

    City Element Field Contact::City

    MobilePhone Element Field Contact::Mobile Phone No.

    Email Element Field Contact::E-Mail

    SalesPerson Element Field Contact::Salesperson Code

    // the trigger code

    // create a local var. contact2 / record / Contact

    Contact - Import::OnBeforeInsertRecord()

    Contact.Type := Contact.Type::Person;

    contact2.SETRANGE("First Name",Contact."First Name");

    contact2.SETRANGE(Surname,Contact.Surname);

    contact2.SETRANGE(Address,Contact.Address);

    contact2.SETRANGE(City,Contact.City);

    contact2.SETRANGE("E-Mail",Contact."E-Mail");

    IF contact2.FINDFIRST THEN BEGIN

     MESSAGE('Contact "' + Contact."First Name" + ' ' + Contact.Surname + ' already exists. Skipping ...');

     currXMLport.SKIP;

    END;

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans