Hi Everyone, I am learning Acumatica. Please help me on below issue.
Whenever ,I open Stock Item Form. I am Getting the below issue.
I’m unable to stop the debugging.

Hi Everyone, I am learning Acumatica. Please help me on below issue.
Whenever ,I open Stock Item Form. I am Getting the below issue.
I’m unable to stop the debugging.
Best answer by Naveen Boga
Hi
You can verify with this code and check once.
public class InventoryItemMaint_Extension : PXGraphExtension<InventoryItemMaint>
{
public PXSetup<AMRPSetup> SetupView;
#region Event Handlers
protected void _(Events.RowSelected<InventoryItem> e)
{
InventoryItem row = e.Row as InventoryItem;
if (row != null)
{
InventoryItemExt inventoryItem = row.GetExtension<InventoryItemExt>();// PXCache<InventoryItem>.GetExtension<InventoryItemExt>(row);
//AMRPSetup MRP = SelectFrom<AMRPSetup>.View.Select(this.Base);
AMRPSetupExt aMRPSetup = SetupView.Current.GetExtension<AMRPSetupExt>(); //PXCache<AMRPSetup>.GetExtension<AMRPSetupExt>(MRP);
bool flag = aMRPSetup.UsrUseDaysSupplytoConsolidateOrders.GetValueOrDefault();
PXUIFieldAttribute.SetVisible<InventoryItemMfgOnly.aMGroupWindow>(e.Cache, row, flag);
//if (inventoryItem.UsrSTOverride == null || inventoryItem.UsrSTOverride == false)
//{
// INItemClass itemClass = SelectFrom<INItemClass>.Where<INItemClass.itemClassID.IsEqual<@P.AsInt>>.View.Select(this.Base, row.ItemClassID == null ? 1 : row.ItemClassID);
// InventoryItemMfgOnly inventoryItemMfg = SelectFrom<InventoryItemMfgOnly>.Where<InventoryItemMfgOnly.inventoryID.IsEqual<@P.AsInt>>.View.Select(this.Base, row.InventoryID == null ? 33 : row.InventoryID);
// INItemClassExt iNItemClass = PXCache<INItemClass>.GetExtension<INItemClassExt>(itemClass);
// if (inventoryItemMfg != null)
// inventoryItemMfg.AMGroupWindow = iNItemClass.UsrDaysSupply;
//}
}
}
protected void _(Events.FieldVerifying<InventoryItem, InventoryItemMfgOnly.aMGroupWindow> e)
{
InventoryItem row = e.Row as InventoryItem;
if (row == null || e.NewValue == null) return;
if ((int)e.NewValue <= 0)
{
//Throwing an exception to cancel the assignment of the new value to the field
throw new PXSetPropertyException(Message.DaysSupplymorethanone);
}
}
//-------------------------------------------------
protected void _(Events.FieldDefaulting<InventoryItem, InventoryItemMfgOnly.aMGroupWindow> e)
{
InventoryItem row = e.Row as InventoryItem;
if (row != null)
{
var ItemClassID = row.ClassID == null ? 1 : row.ClassID;
InventoryItemExt inventoryItem = row.GetExtension<InventoryItemExt>(); //PXCache<InventoryItem>.GetExtension<InventoryItemExt>(row);
if (inventoryItem.UsrSTOverride == null || inventoryItem.UsrSTOverride == false)
{
INItemClass itemClass = SelectFrom<INItemClass>.Where<INItemClass.itemClassID.IsEqual<@P.AsInt>>.View.Select(this.Base, ItemClassID);
INItemClassExt iNItemClass = PXCache<INItemClass>.GetExtension<INItemClassExt>(itemClass);
// e.NewValue = iNItemClass.UsrDaysSupply;
// Acuminator disable once PX1047 RowChangesInEventHandlersForbiddenForArgs [Justification]
e.Cache.SetDefaultExt<InventoryItemMfgOnly.aMGroupWindow>(e.Row);
}
}
}
#endregion
}
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.