Hi,
I am recreating the Get Shipment Lines form so that you can just run this form from the Object designer or the Menu...
So you do not have to create the Invoice first before you can use this form.
Now this is all easy but i have a question.
i created a new Form "Shipped not Invoiced". This form has the table view set to:
WHERE(Qty. Shipped Not Invoiced=FILTER(<>0))
The form just contains a tablebox to display the "Sales Shipment Lines", and a button to create the Invoice(s) for the Selected Shipment Lines.
Now my question is, how can i get all the Lines that the User has Selected, when he presses the button to create the Invoices?
0
Comments
I am showing all Sales Shipment Lines, not filtered on the "Bill-to Customer No."
So the user can select from Multiple Shipments, and for different Customers
So will need two fields from the Filter:
1. The Document No.
2. The Line No.
How can i do this? So that i get the "Line No." filter per "Document No." ?
When i select a Sales Shipment Line with "Bill-to Customer No." = 12345
and a Sales Shipment Line with "Bill-to Customer No." = 54321
Then i receive following error:
The Bill-to Customer No. on the Sales Header 1036 and the Sales Shipment Header 102049 must be the Same
The first Invoice gets correctly created. This has the no. 1036
But when it should generate the new Invoice for the 2nd selected
Sales Shipment Line then it gives the error. The 2nd selected Sales Shipment Line, comes from the Sales Shipment Header 102049
Following code creates the Sales Header(s) and Invoice Line(s) on a button Click:
As you can see i create New Sales Header, every time the "Bill-to Customer No." switches.
CreateSalesHeader(varBillToCust : Code[20];varSellToCust : Code[20])
gv_InvoiceHeader.RESET;
gv_InvoiceHeader.INIT;
gv_InvoiceHeader.VALIDATE("Document Type",gv_InvoiceHeader."Document Type"::Invoice);
gv_InvoiceHeader.VALIDATE("No.",'');
gv_InvoiceHeader.INSERT(TRUE);
gv_InvoiceHeader.VALIDATE("Sell-to Customer No.",varSellToCust);
gv_InvoiceHeader.VALIDATE("Bill-to Customer No.",varBillToCust);
gv_InvoiceHeader.MODIFY(TRUE);
Somebody who see's something wrong with my code/logic ??