function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
DeekDeek 

Unique check for 4 custom fields in a group

Hi All,

 

In Campaign object, there are 4 custom fields where I need to check the uniqueness as a group before its commited to the database

 

Field 1 - Custom Picklist

Field 2-Custom Picklist

Field 3-Custom Picklist

Field 4-Custom Date

 

If the above 4 fields are unique then only it will allow to save the Campaign record.

 

Please help to how it can be achievable.

 

At the moment I have thought of creating a dummy field of type TEXT and making it as unique.

Using Workflow field update I will concatenate the above 4 fields and store the values in the dummy field.

If its unique then only it will allow to save otherwise throw error as its unique.

 

Is that the right approach? Please advise how do I concatenate the 4 fields in the formula editor.

Best Answer chosen by Admin (Salesforce Developers) 
Prafull G.Prafull G.
Thats correct.
Create a TEXT field with unique attribute and then have a WFR to populate this.

Here is the concatenation formula you can use
TEXT(Picklist1) & TEXT(picklist2) & TEXT(picklist3) & TEXT(Date)

Regards,

All Answers

Prafull G.Prafull G.
Thats correct.
Create a TEXT field with unique attribute and then have a WFR to populate this.

Here is the concatenation formula you can use
TEXT(Picklist1) & TEXT(picklist2) & TEXT(picklist3) & TEXT(Date)

Regards,
This was selected as the best answer
DeekDeek

Thanks a lot. Its working as expected. If there are any changes I will post it further. 

 

You rock.