Argument '_voucher' is incompatible with the required type.


I am trying to bring a display method from LedgerJournalTrans Table to Bank Reconciliation Grid but it stop me with the below error. Kindly advice

The message is right - you’re providing wrong parameters when calling the method. Look at IntelliSense or open the method to see it. It accepts three arguments: LedgerJournalId, Voucher and boolean. You’re trying to use false as the value of the voucher, which clearly is a wrong type.

Thank you for your reply. i change the code as per your advice but now the error showing as Variable Voucher has not been declared.

You can’t use variable names that don’t exist.
Also, trying to put this.Voucher as the value of _ledgerJournalId seems to be another bug. I think this should be the second argument.

Use a select to get LedgerJournalTrans related to a BackAccountTrans(this)
select firstonly DocumentNum from ledgerJournalTrans
where ledgerJournalTrans.Voucher == this.Voucher &&
ledgerJournalTrans.TransDate == this.TransDate;

(Or) you can use → \Data Dictionary\Tables\LedgerJournalTrans\Methods\findJournalForVoucher

Hi Kranthi,

Is this code correct? now no error but still the document number is not returning.

return ledgerJournalTrans.DocumentNum;

Done. Thank you

I am marking the thread as answered. In future, please mark the thread as answered if you feel the issue is resolved (by clicking This helped me)