You need to sign in to do that
Don't have an account?
Customizing Duplicate Value Error Message
Hello,
I want an unique combination of fields, so I have a hidden text field that concatenates the values of three fields and this text field is set as unique.The link below explains it better:
http://www.forcetree.com/2010/07/unique-field-combination-in-salesforce.html
When the user tries to create a record with an existing combination of fields, he gets an error message. But I need this message to be intuitive, I need to customize it. If I can't change the displayed error message, this solution won't work for me.
Is there a way of customizing the Salesforce standard error messages?
If not (I'm guessing there's no way), would anyone think of another way of achieving this unique field combination?
Thanks.
You may want to look into writing a trigger for this. the trigger would query the database for that value and if it exists already you would throw an error, which can be any thing you want. I have not tested this at all (just wrote it up on in a text editor, but this is the basic idea
Thanks for your help. It didn't work, though.
When I create a record, before the insert action, the fields are empty. So, this part of the code:
adds to the String List nullnullnull. I realized that using the System Log and some system.Debug() calls.
How can I get the values of the fields in a "before insert" Trigger??
Thanks
Hi,
I tested this in a dev enviornment and should work... I created a formula field called Uniquie Value which concatenated Name + BillingCity + BillingCountry (obviously you can change this to meet your busines rulles).
Here is the code.