Duplicate Static Entity Records after deployment

After Deploying application, static tables automatically create duplicate records in static table and set existing records to Is_active= false.

Deployment log have  "update database" warning message.


How to prevent these duplicate records creation.Production tables are referencing static entity indentifiers duplicate entry creations is messing up with existing data.

Hi Samarpit,

Are you using auto-number in the id attribute of this static entity?

Best Regards

Hi Aureliano,


Yes, Id attribute is set as Auto number. what is the reason of duplicate record creation.


can i delete newly created records and set old record as active from SQL console?

Hi again,

I would try to disable Id as an Auto Number as suggested as well on Outsystems documentation about Static Entities (link) and establish an Id for each record.

Let me know if that works for you.

Best Regards

Hi Samarprit,

I tried to reproduce your issue and the only way I can think of is if I copy-paste the existing entries and delete the old entries that can create new entries (duplicate).

We can't create the same identifier twice even if we set Is_active= false.

The situation that you faced may be a bug in OutSystems deployment. Please report the incident to OutSystems.

I used to follow below best practices for Static Entities. This helps me to avoid unwanted data-relational errors in higher environments.

  1. In the Id attribute, always use Is AutoNumber=False.
  2. Use a specific Id value for each record manually. Id value will never change in higher environments (DEV, QA, UAT, PROD, etc.).
  3. Don't delete any record from the existing list. Use Is_Active=False instead.

Hope this will help.

Regards,

Abhijit

If you get database log warnings, then Outsystems thinks your new records are not the same as the old ones. So yo u have deleted the previous records and then added them again.

then there probably is a protect rule with another entity, which prevents the deletion of those old records. Now you have 2 records.


There could be other reasons causing your situation, but with the information you have given us, this is my best guess.

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