≡ Menu

Invent Journal and its relation with Voucher sequence number Dynamics Ax 2012 R3

 

X++ code for these Invent transfer and movement journal is available in different blogs and website. The voucher number for these entries is little bit tricky. This Voucher Number is set InventJournalName as fellow screen.

xyz

By writing this simple tip I used out of demo vm with contoso data.

So If expand the InventJounralName table we will find this voucher sequence number set in VoucherSequenceNumberTable field.

VoucherSequenceNumber

If we expand the Relation node of InventJournalName table we find its relationship with Sequence Number table based on RecId.

ReleationShip

For getting next voucher Number for Journal lines we have to use static method of NumberSeq  as

 

 

InventJournalName   inventJournalName;

NumberSeq     _sequence;

num _voucher;

select firstOnly inventJournalName

where inventJournalName.JournalType == InventJournalType::Any

ttsBegin;

_sequence=   NumberSeq::newGetNumFromId(   inventJournalName.VoucherNumberSequenceTable);

_voucher=_sequence.num();

ttsCommit;

{ 0 comments… add one }

Leave a Comment