Hi,
I have to create shipment orders from a Sales order..
Conditions:
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.RESET;
RecSalesLine.SETRANGE(RecSalesLine."Document No.",SalesOrderNo);
RecSalesLine.SETRANGE(RecSalesLine."Ref. Item No.",ItemNo);
RecSalesLine.SETRANGE(RecSalesLine."Ref. Line No.",SalesLineNo);
IF RecSalesLine.FINDSET THEN
BEGIN
CODEUNIT.RUN(CODEUNIT::"Ship-Post (Yes/No)",RecSalesLine);// The Sales Header record must be passed.
END;
How can i create a new Posted Shipment Order. Any help will be appreciated.
Thanks in Advance
0
Comments
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav