how to get Order No in sales invoice line?


i want to show Order No in sales invoice line,so i have did bellow work:

Insert a Order No field in sales invoice line table,set property fieldclass =flowfield,calcformula=Lookup(“Sales Shipment Line”.“Order No.” WHERE (Document No.=FIELD(Shipment No.))), is this correct method? if that is right,then,but why does Field menu no "Order No"field when i adding field “Order No” in sales invoice designer form?

any idea do this?thans in advance!



the correct way is to use the Sales Inv. Header as the source table. The order number is in that table.

but there is more than one Order on a sales invoice. does have not any way to add Order No. in sales invoice line?

You might want to tell the whole story if you want help. Are you using combine shipments? If so you need to put the order number on the Inv line through the get shipments funciton.

I think you need to get the Shipment No. first and then just the Order No., it’s easy…

this could be a simple FlowField with this code: Lookup(“Sales Shipment Header”.“Order No.” WHERE (No.=FIELD(Shipment No.))). I tried and it’s working ok, isn’t it?


i have add Order No. field as flowfield on sales invoice line table,but no found Order No. field in field menu in sales invoice subform design form.why is that?

how did you do that?

thanks you very much!

Mean you make an Order and register it to a Shipment or directly to an Invoice (the Shipment will be created too). The Shipment header has a field Order No.

Every invoice line has a field Shipment No. so the flowfield can get the Order No. filtering the shipment with the Shipment No. field. Ensure you have this Order No. field on table Sales Invoice Line (113) and assure your subform has a field displayed for Order No., you can use it as No., Type, etc…

Sales Invoice Subform (ID=47) is the subform for the NOT posted Sales Invoice, and runs on table 37 - Sales Line.
Sales Invoice Line table (which you state to have added the flowfield) - ID=113, is the table for posted Sales Invoice, and is shown in form 133

Maybe this mixup is the reason that you dont find the field in field menu.

I have added the “Order No.” and “Order Line No.” fields to Tables 37 and 113 and modified the code in Table 111 as follows:


SalesLine.“Qty. Invoiced (Base)” := 0;

///new code
SalesLine.“Order No.” := “Order No.”;
SalesLine.“Order Line No.” := “Order Line No.”;
///end new code.

SalesLine.“Special Order Purchase No.” := ‘’;

That way I can get a clear view from all documents what is going on.

This method is particularly useful if you have to produce customs invoices ahead of the actual posting of the invoice as well as tracking by sales order.

I have also copied and modified the Navigate to “Navigate by Sales Order No.” for this particular client. Works a treat.

Rgds, Colin