Skip to main content
Answer

Stock warning when quantity stock is less than safety stock

  • September 5, 2022
  • 2 replies
  • 202 views

Hi All,

 

I would like to ask regarding the stock warning. Is it possible to create a warning if the stock less than determined safety stock when creating Sales Order?

 

Thank you.

Best answer by Naveen Boga

Hi, @nadia02  Yes, you can show a warning message with the small piece of customization.

 

Here is the sample code for reference.

 public virtual void SOLine_InventoryID_FieldSelecting(PXCache sender, PXFieldSelectingEventArgs e, PXFieldSelecting InvokeBaseHandler)
{
InvokeBaseHandler?.Invoke(sender, e);
SOLine row = (SOLine)e.Row;
if (row == null) return;

if(ADD CONDITION)
{

PXUIFieldAttribute.SetWarning<SOLine.inventoryID>(sender, row, "Add Warning Message HERE!!");
}
}

 

2 replies

Manikanta Dhulipudi
Captain II
Forum|alt.badge.img+15

Hi @nadia02 

I believe we can do customization to trigger a yellow warning message when  stock is less than safety stock Just Like Acumatica showing available for shipping is zero thrown an error on hand qty goes negative

we can use the same logic but not sure t the result

 


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

Hi, @nadia02  Yes, you can show a warning message with the small piece of customization.

 

Here is the sample code for reference.

 public virtual void SOLine_InventoryID_FieldSelecting(PXCache sender, PXFieldSelectingEventArgs e, PXFieldSelecting InvokeBaseHandler)
{
InvokeBaseHandler?.Invoke(sender, e);
SOLine row = (SOLine)e.Row;
if (row == null) return;

if(ADD CONDITION)
{

PXUIFieldAttribute.SetWarning<SOLine.inventoryID>(sender, row, "Add Warning Message HERE!!");
}
}