web
You’re offline. This is a read only version of the page.
close
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

I have the same question (0)
  • Brandon Wiese Profile Picture
    17,788 on at

    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?

  • Suggested answer
    Stuart Clouston Profile Picture
    52 on at

    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

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans