could anyone support me with the following requirement?
in model-driven app, I need to add a validation on a field (account) to make sure that it's not duplicated for the same selected value for other field (bank)
lets say we have bank A and bank B, I selected bank A and in account field I choose ACCOUNT-A, the app must get all the records on this table that has bank value A and check if any of these record has account value as ACCOUNT-A, if there's no match then same, else show error message
I've found JS code to make the first part duplicate account prevention descripted in this link,
but i cant add the other bank validation, could you please help me on this?
thank you guys, it works
If I understand the dedup rules trying to do I don't think it would work because it has to retrieve child records and validate against those. But it's true that out-of-the-box duplicate detection rules is a great feature!
Hi, thanks for reaching out. You can certainly use custom code to accomplish this. The JS would give an error to the user as they change the field. However, I believe you can solve this with the OOTB duplicate detection rules. These trigger on save and will validate if a field is unique across all other records of that type.
To use these navigate to Advanced Settings > Data Management > Duplicate Detection Rules. There you can create a new rule and set it to validate off the field you want to be unique across all other records of the same type.
Good Luck!
Hi @mohanade,
Not sure I understand exactly the validation required, but it is possible to share your current code to help? You can have JS (frontend) or plugins (service-side) logic to validate. Depends if you would like this validation to be executed in other scenarios (eg integration or data import). Cheers
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
Super User 2025 Season 2
mmbr1606
275
Super User 2025 Season 2