@Naveen B , I believe the requirement is quite common - produce different stcok items through different production order types (which migh have different WIP accounting and/or controls of possibility to under/overissue materials and overproduce)
@ericklasimin61 , this requirement cannot be impemented through customizing the attribute of the AMOrderType field, even if customizing of attribuite of this field was possible. This order type is always set from the default production order type in Prod Preferences in this handler:
public class SOOrderEntryAMExtension : SalesOrderBaseAMExtension
...
public virtual void SOLine_AMSelected_FieldUpdated(PXCache sender, PXFieldUpdatedEventArgs e, PXFieldUpdated del)
{
del?.Invoke(sender, e);
var row = (SOLine)e.Row;
var rowExt = PXCache<SOLine>.GetExtension<SOLineExt>(row);
...
if (rowExt.AMSelected.GetValueOrDefault() && ProductionSetup.Current != null)
{
rowExt.AMOrderType = ProductionSetup.Current.DefaultOrderType;
return;
}
...
I also believe that the default production order type for a stock item should not be stored withtin an attribute. Attribute values cannot be validated (to match existing order types and other item settings).
I would suggest
- adding the corresponding field to the Stock Items screen which is enabled only when Replenshment Source = MFG (and optionally if Make to Order is checked, see mockup attached)
- override the above handler t derive the AMOrderType from this field when it is not blank
Let me know if further clarifications are needed