Hi everyone, it's me again.
This is my code now, I'm using the canProceedWithInvoicePOsting() method as suggested by @Martin Drà b, but I still get an error once i click Yes on my pop-up. This is my code now:
[ExtensionOf(formControlStr(VendEditInvoice, OK))]
final class VendEditInvoice_OK_AzimutBenetti_Extension
{
private boolean canProceed = true;
public void clicked()
{
IntentLetter_IT intentLetter;
VendInvoiceInfoLine vendInvoiceInfoLine;
Amount totalAmount;
Amount remainingAmount;
RecId intentLetterRecId;
// Ciclo attraverso tutte le fatture
while select * from vendInvoiceInfoLine
{
totalAmount = vendInvoiceInfoLine.LineAmount;
intentLetterRecId = vendInvoiceInfoLine.RecId;
select firstOnly intentLetter
where intentLetter.RecId == intentLetterRecId;
remainingAmount = intentLetter.remainAmountMST();
Info(strFmt('%1, %2', totalAmount, remainingAmount));
if (totalAmount >= remainingAmount)
{
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)
{
canProceed = false;
info('Operazione annullata');
}
}
}
next clicked();
}
public boolean canProceedWithInvoicePosting()
{
return canProceed;
}
public void setCanProceed(boolean _canProceed)
{
canProceed = _canProceed;
}
}
but i get this error: Code execution error: Form Button Control (object), clicked method called with invalid parameters
anyone knows why?
Can it be because of the while select loop?
Thank You.