Sure, sorry if I haven't been clear. In my project I need to display a pop up when, posting a new journal, the TotalAmount of that specific journal is higher of the RemainingAmount of the specified client, as reported on the intent letter. For example If the remaining amount on the intent letter of a client is 100 and I'm posting a journal with a total amount of 1000, it should stop the registration of the journal and the pop up alert should appear. The remaining amount is on the intent letters form, and is a normal field of the intent letters table, while the Total Amount is a calculated field given by the method totalAmountSingleLine found on the form datasource, I can see its code if I look on the class of the form at least, and it's a display method. This is the code I wrote by now, looking on internet for a solution to my problem:
[ExtensionOf(formControlStr(LedgerJournalTransVendInvoice, PostJournal))]
final class LedgerJournalTransVendInvoice_PostJournal_AzimutBenetti_Extension
{
public void clicked(){
IntentLetter_IT intentLetter;
FormButtonControl formButtonControl = any2Object(this) as FormButtonControl;
FormDataSource formDataSource = formButtonControl.formRun().dataSource(tableStr(LedgerJournalTrans));
LedgerJournalTrans ledgerJournalTrans_ds = formDataSource.cursor();
if(ledgerJournalTrans_ds.totalAmountSingleLine() > 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
);
next clicked();
}
}
and I keep getting this error: Error ClassDoesNotContainMethod: Table 'LedgerJournalTrans' does not contain a definition for method 'totalAmountSingleLine' and no extension method 'totalAmountSingleLine' accepting a first argument of type 'LedgerJournalTrans' is found on any extension class.
I hope it's more clear now,
Thank You.