web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :

Voucher not specified as of … Dynamics Ax 2012 R3

Ali Zaidi Profile Picture Ali Zaidi 4,655

A year ago, I did some customization, where ledger entries are done with X++ code. Now client wants Reverse ledger entries. As per logic reverse ledger entries has only difference is debit amount will be credit amount and versa vise. With X++ code  80 percent of these entries are successful, But 20 percent were fail with following Error.

Voucher not Specified as of …

So what is solution. I found only solution to read next voucher from sequence number and assign to ledger trans before posting it. I used following code snippet to get and set next voucher

 

    select firstOnly numSeqTable

where numSeqTable.RecId  == ledgerJournalName.NumberSequenceTable;

if (numSeqTable)

{

numberseq = numberseq::newGetVoucherFromCode(numSeqTable.NumberSequence);

trans.parmVoucher( numberseq.voucher());

}

 

 

Now customization works perfectly fine.

 

Comments

*This post is locked for comments