Hello, I am using RowPersisting event to pop up a confirmation message when user click on save button. This works fine until i save a record. After i save the record, the confirmation message pops up even when i click on Remove hold button. I just want the pop up message to occur only at the save button. Before saving anything it works fine. Nothing pops up when i click remove hold button. But only after the record is saved, the pop up message occurs at the click on remove hold. How can i fix this ? I only want the confirmation message to occur at the save button click even after saving.
This is my code
public void ARInvoice_RowPersisting(PXCache cache, PXRowPersistingEventArgs e, PXRowPersisting baseHandler)
{
if (baseHandler!= null)
baseHandler(cache, e);
ARInvoice invoice = (ARInvoice)e.Row;
if (invoice != null && (e.Operation == PXDBOperation.Insert || e.Operation == PXDBOperation.Update))
{
WebDialogResult result = Base.Document.Ask(
"Confirmation",
"Please confirm the Freight Surcharge Amount. ",
MessageButtons.YesNo,
MessageIcon.Question);
if (result == WebDialogResult.No)
{
//e.Cancel = true; // User clicked "No" in the confirmation dialog, cancel the save operation
throw new PXException("Save Cancelled");
}
Base.Document.Cache.IsDirty = true;
}
}