最新消息:ww12345678 的部落格重装上线,希望大家继续支持。

Voucher not specified as of … Dynamics Ax 2012 R3

网络文摘 alirazazaidi 910浏览 0评论

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.

 

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址