Solved

WebDiaologResult is stuck

  • 21 September 2022
  • 1 reply
  • 81 views

When I reset dialog answer (PaymentCalendar.View.Answer = WebDialogResult.None) in the PaymentCalendar view, my function ,,dublicateItems" Called again and the loop is executed again. How to continue loop execution instead of calling a function?

My code
 public virtual void dublicateItemsOK()
        {
            foreach (DateTime dateTime in dateTimeList) {
                WebDialogResult result = PaymentCalendar.Ask(ActionsMessages.Warning,                   PXMessages.LocalizeFormatNoPrefix(textMessage), MessageButtons.YesNo, MessageIcon.Warning, true);
                 if (result != WebDialogResult.Yes) {
                 PaymentCalendar.View.Answer = WebDialogResult.None;
                 continue; }
              }
}

icon

Best answer by Dmitrii Naumov 21 September 2022, 15:33

View original

1 reply

Userlevel 7
Badge +5

I don’t think there is a way to achieve that as the Ask method that creates a dialog is actually throwing an exception, thus interrupting the code flow. You may try to encapsulate the code inside the loop in a separate method, but I’m not sure if that’s going to help.

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved