Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Missing record in SystemSequences table after AxDbUpgrade causing problem with Multisite Activation

(0) ShareShare
ReportReport
Posted on by 52

Hi All,

I'm having a problem in the process of upgrading our AX3.0 implementation to Dynamics AX 2009.  The problem is manifesting in the Multisite Activation where it is encountering an error when trying to insert a new record into the InventDim table.  From tracing the code I can see that it's trying to get the next InventDimId sequence number from the SystemSequences table.  However, the record it's looking for in the SystemSequences table does not exist, causing it to try and insert a null value into the InventDimId field of the InventDim table.  I have compared backups taken during the course of the failed upgrade against backups taken during the course of succesful test runs and there are significantly less records in the SystemSequences table of the failed upgrade immediately after running the AxDbUpgrade utility.  Of course, I have scanned the log file generated by the utility but found no errors in it.

I am at a loss for what to do next.  Unfotunately our software vendor is also at a loss but charging us time and materials for the inconvenience.

If anyone has any ideas of what I should be looking at or how I can get more information out of the AxDbUpgrade utility, I would be most grateful.

Thanks,
Stuart    

*This post is locked for comments

  • Suggested answer
    Stuart Clouston Profile Picture
    52 on at
    Re: Missing record in SystemSequences table after AxDbUpgrade causing problem with Multisite Activation

    Hi All,

    I actually resolved this issue the day after my initial post.  My apologies for the delay in posting the solution!

    The problem was that under normal circumstances AX2009 would create the SystemSequences record for the InventDim table on demand, however the multisite activation process uses direct SQL statements against the database rather than AX2009’s standard methods, so the record does not get created on demand during the Multisite Activation. The solution is to get AX2009 to create the SystemSequences record by getting it to create a new InventDim record before running the Multisite Activation.

    I achieved this by registering an inventory item with inventory dimensions that I knew would not exist in the database (I just typed my own name in as a serial number).  This created a new InventDim record and the required SystemSequences record in the process.  Of course, to preserve inventory accuracy I unregistered the item before proceeding any further.

    Microsoft eventually provided me with a potential solution, but I had already resolved the problem so I did not use it.  It looks as though it would work but I haven’t tested it so use at your own risk!

    Run the following Job to create the new SystemSequence record
    static void Job1(Args _args)
    {
    RecId recId;
    SystemSequence systemSequence;
    TableId tableId;
    ;

    tableId = TableNum(InventDim);
    systemSequence = new SystemSequence();

    if(systemSequence)
    {
    systemSequence.suspendRecIds(tableId);
    recId = systemSequence.reserveValues(0,tableId);
    systemSequence.removeRecIdSuspension(tableId);
    info('RecId: '+int642str(recId));
    }
    }

    Hope this helps anyone else stuck in the same predicament!
    Stuart Clouston

  • Brandon Wiese Profile Picture
    17,788 on at
    Re: Missing record in SystemSequences table after AxDbUpgrade causing problem with Multisite Activation

    The SystemSequences table is for RecId's (and TransactionId's and System event Id's).  For RecId's, each table is represented with a record with Id == -1.

    Prior to AX 4.0, RecId's were assigned per DataArea, which meant you could have the same RecId in different companies, and thus you would find multiple records for the same table in SystemSequences (with Id == -1 and TabId == tableid).  Starting in AX 4.0, RecId's are now assigned from SystemSequence records from DAT only, and the records from all other companies should be deleted (where Id == -1 anyway).  I have seen cases where Id == -1 records remain for non-DAT companies, and it causes a lot of problems.

    This may explain the fewer number of records in SystemSequences during the upgrade "through" AX 4.0.

    However, InventDimId's are assigned from number sequences, not SystemSequences, so your post is confusing.  What code are you tracing that suggests it can't find a record in SystemSequences?

    Part of the AXDbUpgrade process is the "fixing" of RecId's within tables by re-assigning unique RecId's so that the same RecId no longer exists in different companies.  This is a fairly complex process, because RecId's in one table can be referenced in other tables (aka RefRecId) and sometimes in complex relationships along with reference tableid's (RefTableId).

    Please post as much information as you can about the point of failure.  If tracing SQL, what commands fail?  If tracing X++, what class and code is involved?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,278 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,983 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans