Skip to main content
Solved

Error when click save

  • 12 January 2024
  • 3 replies
  • 111 views

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
         }
    }

3 replies

Badge +12

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

Userlevel 1
Badge

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.

 

Badge +12

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

Reply