I have implemented workflow rule in maintaining unique name in the
Account object everything is fine except that the error message that I'm getting I want to customize to give more meaningful error message then the below message, what do I need to do for that?
duplicate value found: Asset_Name_Dupe__c duplicates value on record with id: 0019000000CZC83
I have created Workflow rules by following this:
At first let us create a new Field on the Account object.
- Go to Setup | Customize | Accounts | Fields.
- Scroll down to Custom Fields & Relationships Section.
- Click New Field.
- Select the Type as: Text
- Name it as: Account Name Dupe Check[Account_Name_Dupe_Check, 255].
- Check the Option: Unique and also select: 'Treat "ABC" and "abc" as different values (case sensitive)'.
- Make it Visible for the appropriate Profiles. While you make them Visible also check the Option: 'Read Only'.
- You need not put them on the Page Layouts.
Now, let us create a new Workflow Rule[Account Dupe Check].
- Go to Setup | Create | Workflows & Approvals | Workflow Rules.
- Click New Rule.
- Select the Object: Account
- Evaluation Criteria: created and every time it's edited.
- Rule Criteria: formula evaluates to true.
OR( ISNEW(), ISCHANGED(Name) )
- Save & Next.
- From under Immediate Actions, click Add Workflow Action to select 'Field Update'[Set the Account Name].
- Select the Field to Update: Account Name Dupe Check
- Select: Use a formula to set the new value
- In the formula box, type in 'Name'.
- Click Save.
- Click Done.
- Activate the WFR.
PS: I do not have apex code yet.