You need to sign in to do that
Don't have an account?
Bharat Chandra Mohanty
prevent Duplication record save based on 2 field
I have created a lightning Web component that accepts input from user and saves the data to the custom setting. Now i want to check duplication of the record based on two fields. Let suppose Name and Contact, i.e if Name and Contact together of the current record is is same as any other existing record then it should not be saved.
How do i handle that in apex And JavaScript?
Thanks In Advance
How do i handle that in apex And JavaScript?
Thanks In Advance
Hi Barat,
You will need Apex to get all values from the Custom setting and compare Name and Contact while creating the custom setting entry from LWC and do not allow creating a new entry when they match. In your JS method which handles the creation of entry for custom setting, you can compare the values obtained from Apex, and display an error message. If it does not match, then continue with creation of entry.
Thank you,
Vinay.