identifying duplicate entries and roll back in database

My applications allows users to register their businesses. Multiple business can have same name (eg ABC Inc). However, two businesses cannot have same address (building no./name, street, city, postcode country). So uniqueness of a record in database is address with several columns (composite key). How do I enforce this uniqueness?


I have created a table called business name with fields - id, businessname, building no/name, street, city, postcode, country). Id is the primary key at the moment. How can I enforce that same business isn't registered twice?

Hi Manu Chadha,

You can add an Index to your Entity (on your Entity definition there's an Indexes property), add all the require Attributes of your entity to the new Index and set it as Unique.

Hope this helps

Manu Chadha wrote:

My applications allows users to register their businesses. Multiple business can have same name (eg ABC Inc). However, two businesses cannot have same address (building no./name, street, city, postcode country). So uniqueness of a record in database is address with several columns (composite key). How do I enforce this uniqueness?


I have created a table called business name with fields - id, businessname, building no/name, street, city, postcode, country). Id is the primary key at the moment. How can I enforce that same business isn't registered twice?

Hi Manu, as Jorge said you need to work with the index of the table, here is a link to give you an overview and some direction: https://success.outsystems.com/Documentation/11/Developing_an_Application/Use_Data/Data_Modeling/Create_an_Entity_Index

Best regards

Hello Manu.

Just a quick non-technical note.

Unless you are targeting very specific businesses, several companies can share a coworking space and have the same address. My company has the official address shared with at least 5 more.