Skip to main content
Solved

Creating Stock items in inactive status


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
  }

 

 

View original
Did this topic help you find an answer to your question?

3 replies

Laura02
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3135 replies
  • 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
  • 3381 replies
  • 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
  • 4 replies
  • June 7, 2022

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


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings