Cache size for recId allocation

In Dynamics AX, recId is assigned according to the nextVal (ID -1, name SEQNO) of SystemSequence table. But the next value of RecId is not always retrieved from the table, and it is cached in client machine’s memory. In AX3.0, the default cache size is 25.
Developers can change the default cache size using SystemSequence class:
In the startupPost method of Application class, you can add the following code:
 
    SystemSequence SystemSequence;  
    …
 
    SystemSequence = new SystemSequence();
    SystemSequence.setCacheSize(30);
 
As a result, recIDs are drawn in sets of 30. That also means that the next value of SystemSequence table will be increased by 30 each time.

In AX 4.0, recIds will be generated unique per table instead of per company.
So for each table, there will be a nextVal (ID -1, name SEQNO) in SystemSequence table. The cache size for recId allocation is increased to 250. And AX 4 does not allow changing cache size for recId allocation anymore. 
This entry was posted in Axapta Development. Bookmark the permalink.

Leave a comment