Skip to main content
Answer

Creating Stock items in inactive status

  • June 6, 2022
  • 3 replies
  • 383 views

Hi All,

Is there a way to set up the the system to create stock items in INACTIVE status by default.

Many thanks in advance.

Best answer by Naveen Boga

Hi, @nazly79  You can achieve this by having a small piece of code/customization. Please find the code below and also I have attached the customization package, you can directly deploy it in your instance and verify.

 public class InventoryItemMaint_Extension : PXGraphExtension<InventoryItemMaint>
{
#region Event Handlers

[PXMergeAttributes(Method = MergeMethod.Append)]
[PXRemoveBaseAttribute(typeof(PXDefaultAttribute))]
[PXDefault(typeof(InventoryItemStatus.inactive))]
protected virtual void InventoryItem_ItemStatus_CacheAttached(PXCache cache)
{
}
#endregion
}

 

 

3 replies

Laura03
Captain II
Forum|alt.badge.img+19
  • Captain II
  • June 6, 2022

Hello, There is no system checkbox that will cause new stock items to default to Inactive status. I checked - there is no approval map available for Stock Items.

You can consider a Business Event to notify [Parts Managers] when a new stock item has been added to the system.

You can consider working with your partner to customize the system behavior and change the default status.


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • Answer
  • June 6, 2022

Hi, @nazly79  You can achieve this by having a small piece of code/customization. Please find the code below and also I have attached the customization package, you can directly deploy it in your instance and verify.

 public class InventoryItemMaint_Extension : PXGraphExtension<InventoryItemMaint>
{
#region Event Handlers

[PXMergeAttributes(Method = MergeMethod.Append)]
[PXRemoveBaseAttribute(typeof(PXDefaultAttribute))]
[PXDefault(typeof(InventoryItemStatus.inactive))]
protected virtual void InventoryItem_ItemStatus_CacheAttached(PXCache cache)
{
}
#endregion
}

 

 


  • Author
  • Freshman I
  • June 7, 2022

Thanks a lot Laura and Naveen for the suggestions. I will look into these.