Validation to prevent duplicate data

Hi, 

I am working on project of inventory management in which I have to design portal for merchant. There are crud operations for products & categories like add, update & delete.

So how I can apply validation to prevent duplicate products & categories ?

Hello vaishnavi, 

there are two way

First way

for example you have two field surname and name

while saving data drag list filter and give the resource as your aggregate(fetch from database of entity where data is storing )

on list filter you will give source and condition as (entity.name=name(input widget)) and (entity.surname=surname(input_widget)))

drag if after list filter in that check list filter is empty or not if empty create data if not empty there is same data is present already


second way and efficient way create index of first name and last name

Index is not give permission to create duplicate 
https://success.outsystems.com/Documentation/11/Developing_an_Application/Use_Data/Data_Modeling/Create_an_Entity_Index#:~:text=In%20OutSystems%2C%20you%20can%20model,and%20create%20a%20new%20index.

check the documentation for reference

Thanks and Regards,

akshay Deshpande

Hi vaishnavi kulkarni,

Use input widgets inside the form , keep mandatory field true in the input widget  and set built in validation as true

and in save logic validate the form  using if condition so it prevent duplicate records saving to database.

Hello vaishnavi, 

there are two way

First way

for example you have two field surname and name

while saving data drag list filter and give the resource as your aggregate(fetch from database of entity where data is storing )

on list filter you will give source and condition as (entity.name=name(input widget)) and (entity.surname=surname(input_widget)))

drag if after list filter in that check list filter is empty or not if empty create data if not empty there is same data is present already


second way and efficient way create index of first name and last name

Index is not give permission to create duplicate 
https://success.outsystems.com/Documentation/11/Developing_an_Application/Use_Data/Data_Modeling/Create_an_Entity_Index#:~:text=In%20OutSystems%2C%20you%20can%20model,and%20create%20a%20new%20index.

check the documentation for reference

Thanks and Regards,

akshay Deshpande

Champion

Hi Vaishnavi ,


Please check below link. You can prevent duplicates by creating indexes. Other way, Before saving, first fetch data from DB and validate from that fetched data, is it existing or not.  

https://www.outsystems.com/forums/discussion/61730/how-to-prevent-duplicate-data-added-into-the-database/


Regards,

Rahul

Hi Vaishnavi,

    You can avoid duplicate values by setting an index property to yes and u can do this by right clicking a particular entity and click edit entity and set the index property to yes. 

Thus avoids duplicates and hope this helps u..

Regards,

Muthu Prabhakar

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