Create a ID which consists of recurring Alphanumeric ?

Hello Network,   I'm working on a project where I need to generate sequential IDs like A0001, A9999. . . . .B0002, B9999. . . . .AB000, etc. Can you suggest algorithms or code examples?   Example Questions:   Generating Alphanumeric IDs with Specific Sequence in Mendix How to implement an ID system with the pattern: A0001, A0002, ..., Z9999, AA0001, ..., ZZ9999? Help me how can I create IDs that increment like A0001, then roll over to AA0001, and continue up to ZZ9999
2 answers

Hello Yogeshwar,


Unfortunately, up to my knowledge, there is not a direct mendix solution for this nor i know any marketplace add on that can provide you with this. 

However, it is possbible to create your own logic with mendix to create your solution. You can for example use different attributes on an entity to track the Numeric Field and the Alphabetical Field and concactenate them to an id field. 

Or you can write your own java or javascript action that create this automatically based on the latest id.


If you want to have more information how to do this you can take a look a different other questions on the forum: 


Hope this helps,


Good luck 


PS: If you need more help feel free to reach out!


Hi yogeshwar,

For this i will go with custom java action but if you want to implement purely within mendix then take a int attribute with value as 1 increment that value in each step and for preceding zero's as 0001 create string variable with 3 zeroes at starting and when int attribute reaches 10 , change string attribute to 2 zeroes and when 100 make it 1 zero something like that.

for alphabets see jurgen answer here


Hope it helps!