+ Start a Discussion
salesforce@14salesforce@14 

Based on query

Hi,

How to check the new record values with all old records in same object using query in before insert operation.

Thanks.
SonamSonam (Salesforce Developers) 
1)You need to write an SOQL to first retrive all the existing records and put them in a list
2)Using a for loop, iterrate in the list comparing each element(record) with the one you are trying to enter.