Surprising behavior of Static Entity in Service Studio

I observed one surprising behavior that while adding record(s) one by one to static entity the identifiers (IDs) are not assigned to each record in the ordered they are entered. For example if I enter "Draft", "Submitted", "Approved" and "Rejected" in that sequence for OrderStatus static entity, then ideally the IDs for them should be 1, 2, 3 and 4 respectively. But it is not so. I deleted and created this static entity twice I got different IDs assigned for "Draft", "Submitted", "Approved" and "Rejected". Though I entered them in that very sequence every time to make sure that I get the desired sequence, i.e. 1, 2, 3 and 4 respectively. I am using Service Studio Community Edition 11.53.9. The following are screen shots of Id and Label for two different attempts (scenarios). Please suggest



Hi Irshad,

1) general advice on id's

If the exact values of id's are somehting you care about, why exactly?  If you have certain expectations/functional uses for a piece of information in an entity, you should add that piece of information as an attribute on top of your id, you should not overload you id with any other meaning than simply to uniquely identify one row.  (typical example would be if you plan on using the id for showing the options in a specific order in your UI, don't, that's what an order attribute is for.)

2) specific advice on static entity id's

Don't have them on auto generate.  This can cause all kinds of problems if you work across several environments, as you have no guarantee that they will get same id in all environments.  This is problematic for moving (test) data between environments, but even simply for troubleshooting etc. it can be very confusing.  If you do this, than as a side effect, you yourself have full control over which record gets which id attributed.

Dorine

Thanks for the quick and valuable response.

One of my question is still there that while I have used several other databases like SQL Server, MySQL, PostGreSQL etc. I observed that the IDs generated for auto identifier is generally in the order the data are entered, Here I find some different behavior.

Anyhow thanks for the super quick response.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.