Posted Shipment

omyvadiyaomyvadiya Member Posts: 124
edited 2014-12-10 in NAV Three Tier
I have to create shipment orders from a Sales order..

The Sales Order can have multiple Items having multiple Charges for a single item, so on cliking Ship Sales Order. Only the first item and its respective charges must be added to the new posted shipment order.

For Eg:

Item 1
Charge -1 (For item 1)
Charge -21 (For item 1)

Item 2
Charge -1 (For item 2)
Charge -21 (For item 2)

so there are intotal 6 lines in a Sales order, on clicking Ship Sales Order, the Item 1 and its respective charges must be Shipped (a new Posted Shipment ) must be created.

What i did:

created 2 new fields in the sales line table named
Ref. Line No. & Ref. Item No.

and passed the Line no 10000 and item no. to other other 2 charge lines....

The problem is when i filter the data and try to call the Posting codeunit, it belongs to Sales Header and not to Sales Line.

RecSalesLine.SETRANGE(RecSalesLine."Document No.",SalesOrderNo);
RecSalesLine.SETRANGE(RecSalesLine."Ref. Item No.",ItemNo);
RecSalesLine.SETRANGE(RecSalesLine."Ref. Line No.",SalesLineNo);
CODEUNIT.RUN(CODEUNIT::"Ship-Post (Yes/No)",RecSalesLine);// The Sales Header record must be passed.

How can i create a new Posted Shipment Order. Any help will be appreciated.

Thanks in Advance


Sign In or Register to comment.