Salesforce does not provide 1-1 objects relationship as we have 1 to many relationship. e.g. one account can have multiple contacts. what if we want to implement similar like one account should have only one contact created and we have to achieve through configuration where we don't need to write code.
Here is the solution. Please follow the steps.
Step1- Create a text field as unique in Contact object.
Srep2- Created a workflow rule on contact object and add field update into it. Update the created text field as a formula. like CASESAFEID(AccountId)
CASESAFEID is used to convert 15 to 18 characters id.
Post deployment step- If you are implementing the above requirement as new requirement and you have existing records created in production then please update newly created text field value using script. because it's a unique field.
Happy Learning!!
Comments
Post a Comment