1031
Views
8
Comments
static entities and their id
Question
Hi,

by default a static-entity got the id as an autonumber.
Why is that so, this means that static-entities over different servers will have a different id possible, I don't like the thought of that:

Now I have to synchronize some data between 2 servers.
This is causing issues because of the static entities (which was unexpected btw)

if I changed the id to a non-autonumber, will the current id's stay, or they become obsolete and effectively destroy the integrity in my database?


thanks in advance,

Joost
2018-03-08 20-43-12
Robert Chanphakeo
Joost, A static entity is much like a standard entity, (maybe with some cache) it means when you create a static entity it's going to create a table in your database, just like a standard entity. If you manually input the identity key, the values you assign to it will always stay the same.
2016-04-21 20-09-55
J.
 
MVP
I understand is works like a normal entity, but what is the point of being static then, except in design mode.

Imho it's semi-static, because you cannot count on the id's being the same in every database you are publishing those statics.

II have a workaround for it, but not happpy about static entities not being static :)
2024-06-12 10-07-10
Daniel Martins
Joost Landgraf wrote:
I understand is works like a normal entity, but what is the point of being static then, except in design mode.

Imho it's semi-static, because you cannot count on the id's being the same in every database you are publishing those statics.

II have a workaround for it, but not happpy about static entities not being static :)
 
Good point, Joost.

Static entities should have the IsAutoNumber set to "No" by default.
It's definitely an interesting idea/behaviour to post at the "Wisdom of Crowds".
It would have my vote.

Regards.
2018-03-08 20-43-12
Robert Chanphakeo
Joost I believe it works the way it does so thay you could easily convert, between entity and static entity!
2021-04-17 17-51-40
George Jeffcock
I guess the trick is as Robert says is to switch off 'Is AutoNumber' and assign yourself the id as you could get in a real mess between environments over time.

(Frustrated as I can't set a Default Value on an entity that refences a static entity, hence looking around this area. Not too frustrated thou as I am enjoying the data modeller)
2018-10-25 01-55-55
Caulibeam

Hi Folks, 

Just curious, since this thread has been open for quite a number of years, has there been any changes to outsystems since then to improve this situation?

2019-05-22 11-30-09
Marcelo Ferreira

Hi Caulibeam,

The default in statics entities is still to be auto number and the id can be different in every environment. I always change this setting IsAutoNumber to No. This way i need to set the id's myself but they are the same in all the environments.

Regards,

Marcelo

2020-06-08 02-42-28
Wasabi

Hi, there are four ways to use this static entity:

1. change the id to type text - so you now create a natural key, instead of synthetic key (auto number)

2. set autonumber off - as suggested above

3. use as is - default autoincrement

4. back door - find physical table relating to that entity, say it ossyss_entity_record, sequence_table, etc

regards

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