Skip to main content
Answer

Save Button Event

  • April 22, 2025
  • 2 replies
  • 56 views

I am working on SalesOrder Screen SO301000.

Problem Statement :-- I want to add the functionality to the page. When Clicking on Save Button I want to know if the Quantity for the for the Row Has changed. If yes, I also want to get the old value and new value and add logic based on the Comparison. But only when clicking on the Save Button
 

 

Best answer by Dmitrii Naumov

You can use RowPersisting event or Persist method override. 

 

I’d recommend trying RowPersisting first. Here is an example:

protected virtual void _(Events.RowPersisting<SOLine> e)
{

if (e.Operation.Command().IsNotIn(PXDBOperation.Insert, PXDBOperation.Update))
return; //if it's delete operation we don't need to do anything


var origQty = (decimal)e.Cache.GetValueOriginal<SOLine.orderQty>(e.Row);
//do your stuff

}

 

 

2 replies

Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • Answer
  • April 22, 2025

You can use RowPersisting event or Persist method override. 

 

I’d recommend trying RowPersisting first. Here is an example:

protected virtual void _(Events.RowPersisting<SOLine> e)
{

if (e.Operation.Command().IsNotIn(PXDBOperation.Insert, PXDBOperation.Update))
return; //if it's delete operation we don't need to do anything


var origQty = (decimal)e.Cache.GetValueOriginal<SOLine.orderQty>(e.Row);
//do your stuff

}

 

 


darylbowman
Captain II
Forum|alt.badge.img+15

...event on Persist method

OR