You need to sign in to do that
Don't have an account?
himanshu huske 7
sfdc_Trigger_Example
help me with trigger code.
An object has FirstName and LastName field, if we try to create a record with same FristName and LastName, record should not create(throws error).
An object has FirstName and LastName field, if we try to create a record with same FristName and LastName, record should not create(throws error).
Hope this helps!
All Answers
I'll suggest you go with Duplicate Rules instead of trigger because as the data grows within your org it will impact the performance.
Just create a matching rule, where it will check for first name and last name.
Create a duplicate rule using that matching rule and you are good to go.
You can choose whether to show alert when a user create a new matching record or just block it from creating.
https://trailhead.salesforce.com/content/learn/modules/sales_admin_duplicate_management/sales_admin_duplicate_management_unit_2
Hope this helps!
Hope this helps!