Quantcast
Channel: Microsoft Dynamics 365 Community
Viewing all articles
Browse latest Browse all 17314

How to find next value from sequence number when sequence number reference not in parameter table.

$
0
0

Many times we have to generate and assign sequence number in X++. And usually we find attached sequence number form Parameter tables.  We can get customer through following X++ code

 

NumberSeq     _sequence;

ttsBegin;

 

_sequence = NumberSeq::newGetNum( CustParameters::numRefCustAccount());

    info((_sequence.num()));

info(_sequence.Num());

    info((_sequence.num()));

 

ttsCommit;

 

But sometimes these reference methods did not available in these Parameters table. For these fields you can get sequence number with reference to extended data type. For example if you have to find next value for CustInvoiceId of Free text Invoice of customer you have check the extended data type of field. And then get the next number with reference to Extended Data Type

 

NumberSeq     _sequence;

ttsBegin;

_sequence = NumberSeq::newGetNum( NumberSeqReference::findReference(extendedTypeNum(CustInvoiceId)));

info((_sequence.num()));

ttsCommit;

 


Viewing all articles
Browse latest Browse all 17314

Trending Articles



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