Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 72043

Code reason is required

$
0
0

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!!


Viewing all articles
Browse latest Browse all 72043

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>