How to import skip empty fields using Xml port in sales order..

I have created a XML port with sales header as a parent and sales line as a child and i want to import some data to it .But when i do this the empty records in the sales order must be skipped and move on to the next record .

For Ex.

In sales header I have a field called alternate number and i want skip the header which does not contain alternate number and the correspnding lines must also be skipped and the next record must be imported.

Please help...

Thanks in advance..

Answers

  • Slawek_GuzekSlawek_Guzek Member Posts: 1,690
    It depends how did you structure your XML port.

    You could add something like
    IF "alternate number" = '' THEN
      CurrXMLPort.Skip;
    
    in Import::OnBeforeInsertRecord() trigger on the header, and
    IF NOT SalesHeader.GET("Document Type", "Document No") THEN
      CurrXMLPort.Skip;
    
    for sales lines

    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
  • bharathnanbharathnan Member Posts: 92
    uuoj26xl6p2i.png
    7j27sy8zldsa.png
    mh2yklhaotpr.png
    xpqqb9171847.png

    Thanks for the reply.
    I have this much so far now i am able to import but i am unable to skip a particular data .I tried using your code by using it in XML port but it doesn't work



    Ex.In the above notepad file when something data(ex.model or line no)is missing then the complete detail about that vehicle must be skipped and it should pass on to the next data present in the notepad file.
    please advice...
    Thanks in advance
Sign In or Register to comment.