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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

How to skip empty lines in an XMLPORT

(0) ShareShare
ReportReport
Posted on by 4,188

I'm using XMLport to import data . The format is like first line is the header, second line is blank, third line contains data next line is blank. How to handle such situation ?

xml.JPG

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    RockwithNav Profile Picture
    8,707 Super User 2025 Season 2 on at

    Did't you tried something like this, For any single field you can try

    If Rec.Field = '' THEN

    CurrXMLport.SKIP;

  • CDsilva Profile Picture
    4,188 on at

    I have tried that.

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    What is the RecordSeparator and the field separator in this file? It's not clear from the image.

  • CDsilva Profile Picture
    4,188 on at

    file.JPG

    one of the field is a primary key while importing error is thrown Field ='' already exist. 

    on Field -Import::OnBeforePassVariable I've coded i

    If Field='' then currXMLport.skip;

    still doesn't work

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    Ok thanks. If so, I think that in Import::OnBeforeInsertRecord() you can test if fields are blank and then use currXMLport.SKIP.

  • Suggested answer
    RockwithNav Profile Picture
    8,707 Super User 2025 Season 2 on at

    May be you are writing in incorrect trigger. That's the only standard way to Skip in Report Dataport and Xmlport.

  • Suggested answer
    CDsilva Profile Picture
    4,188 on at

    You were right Steffano, I had to put the test condition on port::OnBeforeInsertRecord() and it worked.

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

News and Announcements

Season of Giving Solutions is Here!

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)

#1
HoangNam Profile Picture

HoangNam 7

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans