Source Type in Production order header

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”.

Summary:

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?)?

Thanks

Dave K

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[20];ProdOrdLineNo : Integer;VAR SalesOrderNo : Code[20];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

BEGIN

Reservation2.SETFILTER(“Entry No.”, ‘%1’, Reservation.“Entry No.”);

Reservation2.SETFILTER(“Source Type”,‘37’);

Reservation2.SETFILTER(“Source Subtype”,‘1’);

IF Reservation2.FINDSET THEN

BEGIN

SalesOrderNo := Reservation2.“Source ID”;

SalesOrderLineNo := Reservation2.“Source Ref. No.”;

FoundOrder := TRUE;

END;

END;

The Reservation variables are the 337 Reservation Entry table.