Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

How to manage Document no while import sales order ?

(0) ShareShare
ReportReport
Posted on by 977

Hi Expert ,

     I have created a xml format file using .net.This xml format is below 

  

<Root>

<Header>
<DocumentType>Order</DocumentType>
<PostingDate></PostingDate>
<OrderDate></OrderDate>
<BillToCustomerNo></BillToCustomerNo>

<Line>

<DocumentType>Order</DocumentType>

<Type>2</Type>
<ItemNo></ItemNo>
<DocumentNo></DocumentNo>
<Description></Description>

</line>

<Terms>14 days</Terms>

</Header>

</Root>

I have created same type of xmlport . is it work  or i need to be define DocNo for header and line label in xml document and xmlport.

thanks

surajit

*This post is locked for comments

  • Suggested answer
    Roberto Stefanetti Profile Picture
    Roberto Stefanetti 12,998 on at
    RE: How to manage Document no while import sales order ?

    Hi,

    i think that you need to generate new NAV orders numbers from xmlport and after pass it to header & lines,

    if you have order number > map & pass No. on header & "document No." on Lines sections of XML port.

    Look at xmlport "Inbound Sales Order", is an example

    1 - Table InSalesDocHdr(Inbound Sales Document Header)  > HEADER TABLE

    "On Before Insertrecord" trigger

    you have this function :

    XMLDocTransform.PopulateInSalesDocFields(InSalesDocHdr,TrackingID,PartnerNo,BizTalkSalesDocType::Order);

    InSalesDocHdr."Doc. Transformation Succeeded" := TRUE;

    This function compile some fields not mapped on xmlport

    you can add for example "Sales Header"."No." using a function like XMLDocTransform... or assigning directly a value

    "Sales Header"."No." := GetNextNo(...) with standard numbering NAV functions

    2 - Table InSalesDocLine(Inbound Sales Document Line) > LINES TABLE

    Sales lines

    > you can pass "Document no." directly by liktable & linkfields links & with forceInsert =True

     or assigning "Sales Header"."No." that you have assigned before)

    ex:

    linktable > InSalesDocHdr

    linkfields > Inbound Document No.=FIELD(Inbound Document No.)

    On XML Import

    > you don't need to map "No." & "Document no." attributes for header & lines if you need to generate news orders numbers

    > if you have more fields mapped on xml structure system in import checks all fileds,

    On XML Export

    > you must map all fields or variables (fixed structure)

    XMLport Sales Order Example

    msdn.microsoft.com/.../dd338612.aspx

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,489 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans