Skip to main content
Answer

Error when click save

  • January 12, 2024
  • 3 replies
  • 121 views

Forum|alt.badge.img

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

Best answer by darylbowman

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

3 replies

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

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


Forum|alt.badge.img
  • Author
  • Freshman I
  • January 16, 2024

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.

 


darylbowman
Captain II
Forum|alt.badge.img+15
  • Answer
  • January 16, 2024

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