How to move data of static entity from one environment to another

Hi,

I have a basic question on static entity. As these entities are not available for DML operations from the UI in the run time, whether data of a static entity will be moved from one environment to another while deploying the code ? 


Thanks,

Karthik 

Karthik Jeyaraman wrote:

Hi,

I have a basic question on static entity. As these entities are not available for DML operations from the UI in the run time, whether data of a static entity will be moved from one environment to another while deploying the code ? 


Thanks,

Karthik 


When the data of the static entities is moved from one environment to the another, one thing which I have noticed is the change of the Ids. Example: If you have an Static Entity as Country with record in it as India having Id as 1. Once you move from one environment to another, the Id changes.

Priya Khade wrote:

Karthik Jeyaraman wrote:

Hi,

I have a basic question on static entity. As these entities are not available for DML operations from the UI in the run time, whether data of a static entity will be moved from one environment to another while deploying the code ? 


Thanks,

Karthik 


When the data of the static entities is moved from one environment to the another, one thing which I have noticed is the change of the Ids. Example: If you have an Static Entity as Country with record in it as India having Id as 1. Once you move from one environment to another, the Id changes.

Thanks Priya, Will it move the data of static entity from DEV to SYST while deploying the code ? 


Hi Karthik,

Yes it will. During the deploy on the stage that updates the database a sql will be created to create those statics and respective options. If you don't have the same problem as Priya I like to set the ID of statics property "Is AutoNumber" to false,

Regards,

Marcelo

Hi Karthik,

May I ask why you thought the Static Entities wouldn't be created on the target server when deploying? I mean, they are created automatically when you create them on publish, so why wouldn't a publish on another environment not recreate them?

Also, the data isn't actually "moved". The Static Entity is just created if it doesn't already exist. Like Priya said, auto numbers are not guaranteed to be created the same across environments, so it's best to either just set the auto number property of the Id to False, like Marcelo wrote, or (what I like to do) use a short, meaningful Text as Id (which also helps recognizing the values in query outputs).