I'll try to explain briefly my goal. My code should display a NoYes pop up when I click on a butto and a certain condition happens, If I press Yes the code keep going, if I press No it stops. I used a Chain of Command class, as an axtension of the button on my form, This is my code:
[ExtensionOf(formControlStr(VendEditInvoice, OK))]final class VendEditInvoice_OK_AzimutBenetti_Extension{ public void clicked() { IntentLetter_IT intentLetter; VendInvoiceInfoLine vendInvoiceInfoLine; if(vendInvoiceInfoLine.LineAmount > intentLetter.remainAmountMST()) { DialogButton diagBut; str strMessage = /Importo da decurtare al saldo della lettera di intento maggiore dell’importo residuo. Proseguire?/; str strTitle = /Splafonamento/; diagBut = Box::yesNo( strMessage, DialogButton::No, strTitle ); if(diagBut == DialogButton::No) { return; } } next clicked(); }}
But I get this error once I build the project: call to 'next' should be done only once and unconditionally.
I assume that's because if I press No, the code returns and the method next is never called, because if I delete Return and put for example an info, everything works fine. How Can i do it in a different way that works?
Thank you very much.