Skip to main content

I have included a confirmation message when click on save. If user click yes it proceeds to save. If click no i get this error. I just to to avoid save if click no but instead i get this. Why is that ?

 

My code:

  public void ARInvoice_RowPersisting(PXCache cache, PXRowPersistingEventArgs e, PXRowPersisting baseHandler)
    {
     if (baseHandler!= null)
                baseHandler(cache, e);
           
        WebDialogResult result = Base.Document.Ask("Confirmation", "Do you want to save?", MessageButtons.YesNo);

         if (result == WebDialogResult.No)
         {
             e.Cancel = true; // User clicked "No" in the confirmation dialog, cancel the save operation
         }
    }

Could you check the trace log and post the results when this error occurs?


Could you check the trace log and post the results when this error occurs?

Hi @darylbowman ,

I solved this issue by providing a “ throw new PXException("Save Cancelled")” when the user clicks No. Anyway here’s the trace log when the error occurs.

 


If you don't provide a message to the exception, I believe it is silent. This may be more user friendly 🙂


Reply