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)

How label IDs are generated?

(0) ShareShare
ReportReport
Posted on by 314

Hello All

Does anyone have any good documentation on how labels work under the hood? how is the label ID generated?

I am currently facing an issue. When I create a new label, it immediately creates blanks labels in the table ElementModelLabel in all the languages. After restart AOS the En-us language label is created; which is fine and exactly how it should work. 

But why is it creating these blank labels for different languages?

This is currently not affecting our application except for the blank labels for different languages in the ElementModelLabel table.

2nd issue I am facing is we have the same modelStore installed in two different environments. But when I create a new label the next label Id that is generated is not the same in the two environments. EX : If the last label is @ABC206, then in first env the next label generated gets label id @ABC215 and in 2nd env it is @ABC210.

Also Label.maxlabelid("ABC"); returns the above values.

Should'nt both env. be @ABC207?

Where does it get these values.

Thank you

Abby

Thanks

Abby

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    That is the expected behavior. If you did not provide translations in other languages you have your License for, the label will be blank there. Label IDs are fetched sequentially within each environment.

    You should be using a Version Control system like TFS hooked up against your developer workspace, in which case labels would go in temporary label files in a format like $AA001 until you check them in to your version control repository. Then they would be replaced with the correct value for the single shared label file. Then from that TFS repository you could synchronize the latest labels to your developer workspaces, or merge the change to other TFS branches to promote the code to Test/Live.

  • Abby Abraham Profile Picture
    314 on at

    Hello Vilmos.

    With regards to the blank labels, it looks like it is only for recent labels. Querying on the ElementModelLabel Table, the blank records exists only for the newer labels. I queried for all labels where language != en_us. It only shows the recent labels ( all blank). We have not made any changes to the license etc.

    The two environments in question are not connected to TFS. Would you know the logic for getting the next label id? in the ElementModelLabel table the last label is @ABC206.

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    Label fetching happens in the kernel, but from experience I can tell that it is sequential per environment. But you can override that in the XPO Import dialog for example (reusing existing labels, or creating new ones).

    The "fix" is not to create labels in two or more places for the same Label name, and do not transfer code between environments containing code referring to labels which were not uniformly generated because you violated the previous rule.

    Use TFS (or environment-specific label names), problem solved.

  • Abby Abraham Profile Picture
    314 on at

    Yes I see your point. The reason why I created the two environments is just to test the label generation. My machine is the only developer machine as I am the only developer. I started investigating this only because when I created a new label it created label id not in sequence. So I created a new env with my model store to further test.

    Currently our process is I develop code. I then import this xpo into a test environement. After testing we export the model store and import this model store to prod.

    We are currently working to implement TFS.

    Thanks.

  • Vilmos Kintera Profile Picture
    46,149 on at

    Kindly mark helpful answers next to each post to resolve the thread.

  • Abby Abraham Profile Picture
    314 on at

    Thanks Vilmos for letting me know its the standard behavior.

    I am still trying to figure of how the kernel determines the next Label Id. Playing with the ALD files in the application folder.

    Will post any updates.

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