web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)
Suggested Answer

Xref: Update data model - best practice on how to update after deploy

(0) ShareShare
ReportReport
Posted on by 2,433

Hi,

One of the cross references you can update is the "Update data model". You can execute this in the development workspace | Tools | Cross References | Periodic | Update. It takes a minute or so to update, and fills the xRefTableRelation table.

This information is used when the user adds data sources to queries to add ranges on data sources that are not in the original query.

I found 3 ways so far to initialize this Xref data:

  1. Using Tools | Cross References | Periodic | Update
  2. By doing data dictionary synchronize (only works if the table is empty)
  3. On first use, the user is presented with the question "The cross-reference system has not been updated. Do you want to update it now?" (only works if the table is empty)

So my question is: after deploying new code (eg in TST, ACC or Production environments), what is your strategy to make sure this Xref is up to date?

I was thinking:

  • Schedule it in batch but this option is not available (in FP, there is one in R2 it seems)
  • Truncating this table manually after new code is deployed (and before DD sync that fills it again)
  • Customizing the class SysCheckListItem_Synchronize so the table is truncated before DD sync so that it is taken care of by the Software Update Checklist

Am I missing something? What is your strategy to keep this Xref up to date for users?

*This post is locked for comments

I have the same question (0)
  • DavidSturt Profile Picture
    4 on at

    Hi,

    To my knowledge the data sources used by queries come from the relations used in the AOT, or AOT queries and not the cross reference data.  More details can be found here daxmusings.codecrib.com/.../query-object-datasource-linking.html

    The cross reference data is used as a developer tool to understand how all objects are related in the AOT.  You can use the steps in this article to keep the cross reference data up to date msdn.microsoft.com/.../aa877386.aspx. You can set the compiler to update cross references during compile.  You should not need to update the cross references in production environment since you should not be updating AOT objects.

  • Community Member Profile Picture
    on at

    There seems to be another way to do this:

    msdn.microsoft.com/.../cc566587.aspx

    Just found this one via google, so i haven't tried this one yet :)

    xRefUpdateIL::updateAllXref does create a batch job, which you could schedule (AX 2012 R2)

  • DavidSturt Profile Picture
    4 on at

    Good point, Andy.

    Klass - If you take the command line approach, don't forget that you need to set the compiler to update cross references first.  Otherwise you will just be doing a compile without updating the xref data.  Also, keep in mind that this takes hours to run and can affect system performance so make sure to schedule to run nightly if you are going to set up a batch or scheduled task.

  • Klaas Deforche Profile Picture
    2,433 on at

    Hi Andy,

    Thanks, I know about xRefUpdateIL::updateAllXref, but that is only on R2, and we are on FP.

  • Klaas Deforche Profile Picture
    2,433 on at

    Hi David,

    I do not wish to update the complete cross reference. I only want to update the data model. This is something that is needed in for example a production environment. It takes about a minute to generate this.

    When this is generated, the user is able to add new data sources to queries using the select button. Take the vendor report for example (Accounts Payable - Reports - Vendors - Vendors). If you click the select button, you can then right click the "Vendors" data source and add other data sources using the 1:n and n:1 menus.

    If you add new relations to the AOT, this is not automatically updated.

    So what is the best practice to keep this Xref up to date after new code has been deployed?

    (Or maybe no one cares about that and just waits for users to say "I can't select this new table you added in my queries?)

  • Suggested answer
    DavidSturt Profile Picture
    4 on at

    Hi Klass,  the class 'xRefTableRelationUpdate' is responsible for updating the records you mentioned.  This class extends the RunBaseBatch, but is set to not allow batch processing.  If you change the method 'canGoBatch' in the 'xRefTableRelationUpdate' class to return TRUE instead of FALSE, then you will be able to schedule the process in batch by running the class.  Unfortunately I can only test this in R2/R3, but it did work for me in a quick test.

    I do not know if this is a MS best practice, but this would keep the xRefTableRelations up to date.  If you upgraded AX or applied hotfixes then you would need to monitor changes to that class.

  • André Arnaud de Calavon Profile Picture
    306,757 Super User 2026 Season 2 on at

    Hi Klaas,

    Just a simple approach. Run this job manually after a release. I assume you will not have weekly updates? So: Tools | Cross References | Periodic | Update

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans