I want to use the Planning Worksheet to create production orders based on Sales order demand.
When I do this, the production order has the Source type as Item.
How do I make this default to Sales Header and contain the sales Order number in the Source No. field ?
I am using NAV 2013 and I have the items set to “Tracking & Action Msg”.
I create a Sales Order, then use the Planning Worksheet which creates a Planned Production Order.
The Source type in the Production Order is Item
I want it to be Sales Header and have the Sales Order Number showing.
Is there a bug in NAV ? or do I need to change a setting (if so, what setting?)?
I have written a function in C/AL to obtain the Sales Order No and Line No that was the demand for the given Production Order No. and line. Since we will only create Production Orders from Sales Order demand using the Planning Worksheet, this should always work for us :-
GetSalesOrderNo(ProdOrdNo : Code;ProdOrdLineNo : Integer;VAR SalesOrderNo : Code;VAR SalesOrderLineNo : Integer) FoundOrder : Boolean
FoundOrder := FALSE;
Reservation.SETFILTER(“Source Type”, ‘5406’);
Reservation.SETFILTER(“Source Subtype”, ‘3’);
Reservation.SETFILTER(“Source ID”, ProdOrdNo);
Reservation.SETFILTER(“Source Prod. Order Line”, ‘%1’, ProdOrdLineNo);
IF Reservation.FINDSET THEN
Reservation2.SETFILTER(“Entry No.”, ‘%1’, Reservation.“Entry No.”);
IF Reservation2.FINDSET THEN
SalesOrderNo := Reservation2.“Source ID”;
SalesOrderLineNo := Reservation2.“Source Ref. No.”;
FoundOrder := TRUE;
The Reservation variables are the 337 Reservation Entry table.