Creating Look up or Master-Detail
The steps to create a Look up or Master-Detail relationship are the same except that you need to choose the appropriate Field Type.
The below are the steps to create Look up Relationship :
In case of Standard object :

*** Go to Setup - Customize - Expand the options for the appropriate object on which you want to create a Look up Relationship - click on Fields
In case of Custom object :
Setup - Create - Objects - <select the object> - New in the fields section.
*** Choose Lookup Relationship and hit Next
*** Fill in the required details :
On Standard Object :
Setup - Create - Objects - <select the object> - New in the fields section.- Choose Master Detail relationship in the Field Type
You may have seen the options here that say 'What to do if the lookup record is deleted?' . Here if you choose
- 'Clear the value of this field. You can't choose this option if you make this field required.' When the associated, parent object is delted, the value in the lookup field goes blank. But this option cannot be used with 'Always require a value in this field in order to save a record' enabled.
- 'Don't allow deletion of the lookup record that's part of a lookup relationship.' Choosing this option, you would not be allowed to delete a Parent record when ever there is an associated Child record.
*** Proceed clicking on Next until you see the page where you can hit the Save button.
[You may choose the profiles to which you would want to grant access, also can you choose which are the layouts on which you would want this field to be a part of .
The below are the steps to create Master Detail relationship :
*** Go to Setup - Customize - Expand the options for the appropriate object on which you want to create a Master Detail Relationship - click on Fields
On Custom Object :
Choose the object to which the current object should be made a child of.
Fill in the necessary details like Name , Description,etc.Then click Next , Next and Save
Sharing Settings :
In the process of creating the Master-Detail field, you would have come across Sharing Setting section which, just like in the pic above,
If 'Read Only: Allows users with at least Read access to the Master record to create, edit, or delete related Detail records.' is selected, there has to be a minimum Read permission to the Master record to be able to create, edit or delete records in the Detail objects
If 'Read/Write: Allows users with at least Read/Write access to the Master record to create, edit, or delete related Detail records.' is chosen, then to be able to create , edit or delete records in the Detail object.




Comments
Post a Comment