One to One relationship in Salesforce

As of now, there is not out of box functionality available to create one-one relationship but there are way we can create one-one relationship in Salesforce.

  1. When both object are having Lookup Relationship.
  • Create a unique field on Child object.
  • Write a Workflow on Child object, for any change in the lookup field, to capture the lookup field value to unique field.

Now one-one relationship is created for both.

Disadvantage of this process is –

  • Creating an extra field.
  • Utilizing the Unique field limit.[7 External ID fields per object]
  • Using a workflow.
  1. When both object are having Master Details Relationship.
  • Create a roll-up summary field on Master to get the Count of Child.
  • Write a validation rule on rollup summary field to check greater then 1. It will give you error if it has more than one record.

Disadvantage of this Process is –

  • Feasible only if relationship is Master-Details.
  • Consuming rollup summary limit.[25 Rollup Summary Fields]

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s