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; }
}
}
Answer
WebDiaologResult is stuck
Best answer by Dmitrii Naumov
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.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.