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

How to get Next RecId through X++

$
0
0
Below piece of code can be used to retrieve next record Id from the table.

staticvoidgetNextRecId(Args _args)
{
    //Table that stores record ids details for tables
    SystemSequences systemSequences;

    //Class that handles Record id generation
    SystemSequence systemSequence = newSystemSequence();
    ;

    info(strFmt("%1", tableNum(SalesTable)));  
   
    systemSequence.suspendRecIds(tableNum(SalesTable));
    info(strFmt("Next record id: %1", systemSequence.reserveValues(1,tableNum(SalesTable))));
    systemSequence.removeRecIdSuspension(tableNum(SalesTable));
}



Viewing all articles
Browse latest Browse all 53207

Trending Articles



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