Skip to main content
Answer

Default Production Order Type

  • December 21, 2021
  • 2 replies
  • 329 views

Forum|alt.badge.img

Hi there,

I have a requirement where I would need to grab a value from Stock Item attribute, trim it down to the first letter and assign it to Production Order Type as shown below:

 

However, when I tried to customize the field itself, I was greeted with the following pop up:

 

Is there any other way to edit this field via Customization Project Editor?

Best answer by mvolshteyn

@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 

2 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • December 21, 2021

Hi @ericklasimin61  I have couple of doubts on your requirement, Can you please clarify? 

  • Please provide an example for the Stock Item attribute value and when you wanted to see the default Production Order Type?
  • May I know why you wanted to override the attribute?

mvolshteyn
Acumatica Moderator
Forum|alt.badge.img+3
  • Technical Account Manager in the ISV Team
  • Answer
  • December 22, 2021

@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