Solved

Default Production Order Type

  • 21 December 2021
  • 2 replies
  • 259 views

Userlevel 2
Badge

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?

icon

Best answer by mvolshteyn 22 December 2021, 09:39

View original

2 replies

Userlevel 7
Badge +17

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?
Userlevel 5
Badge +3

@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 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved