Hi all,
We are building a web application and we are creating all the entities from scratch for it. I am preferring to keep all my entity's id attribute 'AutoNumber' property set to 'Yes'. Can someone suggest if I can go with 'AutoNumber' set to 'Yes' approach? There are many reference attributes also. If so, are there any consequences for this? I heard somewhere that setting 'AutoNumber' to 'Yes' would impact the data when we deploy our application from one environment to another. Which one is the preferred approach when developing enterprise level application?
Hey,
Keeping it as auto-number is the preferred way to do it.
As for the impact when deploying applications from one environment to another indeed, the data created in different environments might have different IDs (as primary keys), but shouldn't impact your logic unless you really rely on the main ID of the entity to uniquely identify records across environments.
Regards,
Bogdan
Hi,
Keep them automatically numbered, but on static entities it is preferable to remove the automatic numbering
Hi Bruno,
Thanks for the response. Can you please tell me why is it recommended to remove auto numbering from static entities?
well It is described in official documentation :
"Using auto-number is not recommended, as it might generate issues in complex scenarios"
https://success.outsystems.com/Documentation/11/Developing_an_Application/Use_Data/Data_Modeling/Static_Entities?_gl=1*17j6643*_ga*MjAxMTUxMjU4NC4xNjUwMzg5MjQ0*_ga_ZD4DTMHWR2*MTY1Mjc2NzA2My4xLjEuMTY1Mjc2OTEwNi4zNw..
Hi Krishnnambal,
It is recommend to keep auto-number property to 'Yes' so that you don't need to worry about sending an extra attribute for ID, OS will take care of it in sequential manner with unique number. Regarding deployment, until and unless you are not migrating data, you don't need to worry about it. While creating reference attribute, give attention on 'delete rule', its very importance to select proper delete rule.
Official Doc for auto-number : https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Data/Database_Reference/Auto_Numbers_on_Database?_gl=1*qi458c*_ga*MjAxMTUxMjU4NC4xNjUwMzg5MjQ0*_ga_ZD4DTMHWR2*MTY1MjcxMTI3MS4xLjEuMTY1MjcxMTg4Mi42MA..
Sanjay