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.
- 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.
- 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]