Hi,
I want to check if the invoice number already exists on the type of Vendaccount in module : purchases> invoice journal.
I add this code in validaWrite():
invoice = ledgerJournalTrans_ds.object(fieldnum(LedgerJournalTrans,invoice)).getValue();
ledgerJournalACType = ledgerJournalTrans_ds.object(fieldnum(LedgerJournalTrans, AccountType)).getValue();
if(ledgerJournalACType==ledgerJournalACType::Vend )
{
select ledgerJournalTrans where ledgerJournalTrans.AccountType==ledgerJournalACType && ledgerJournalTrans.Invoice==invoice;
info(strfmt("invoice %1,type %2",invoice,ledgerJournalACType));
if(ledgerJournalTrans.RecId)
{
isValid = checkFailed(strfmt("the invoice number "+ invoice +" already exists on the type of vend account! "));
}
}
I try to add new line in invoice journal but when I save this I get error: "Code reason is required"!!
I don't know the source of error!!
*This post is locked for comments