Relationships
Relationships
==============
By using this feature, we can map the association / relation among the Two objects
inside the Organization.
While Mapping the association between the Two objects, we have to follow the below
2 steps.
1. Lookup Relationship
2. Master-Detail Relationship
3. External Object Lookup Relationship
4. Hierarchical Relationship
Lookup Relationship:
====================
UseCase:
========
Configure the Lookup Relationship between the "Course" object and the
"Student" object. And list out all the observations / functionalities.
Observations:
-------------
1. Lookup Relationship provides One-Many Association between the records.
i.e. A Parent Record can be associated with one or more child records.
5. In Lookup Relationship, Upon removing the parent record, only parent will
get deleted. Child Record will existed as it is. i.e. Child Record will
not be deleted.
But, in the Child Record, the Lookup Field value will get Cleared out.
6. We can make the Lookup Field required by selecting the "Required Checkbox"
upon Creating / Editing the Lookup field.
7. If the Lookup Field is a Mandatory Field. Then if the user tries to Remove
the Parent Record, Which is associated with a Child Record. Then
Salesforce won't allow to remove the Parent Record.
10. Both Parent Record and Child Record contains the "Owner field".
12. We can make a Standard Object as a "Child Object" with Custom Object as
parent with "Lookup Relationship".
Lookup Dialog will represent max. of 200 Parent Records in the Tabular
format. We can search the remaining parent records with the help of Search feature.
Note: By default, Lookup Dialog will represent Only the Parent Record Name in
the Table.
We can Customize the Table, to represent the required fields on the Table as
below.
Master-Detail Relationship:
===========================
Student and Fees
UseCase:
========
Configure the Master-Detail Relationship between the Student and Fees Object
and list out all the Observations.
Observations:
1. Master-Detail Relationship provides One-Many Association between the
Objects.(i.e. A Parent Record can be associated with One / More
Child Records)
Sol 1: Remove all the Child Records from the Child Object
Permanently.
And Map the Master-Detail Relationship between the
objects.
5. While Removing the Parent Record, all the related child records will
get deleted automatically.
7. Parent Record Contains the "Owner Field". But, Child record doesn't
have the "Owner Field".
Pre-Requisite:
Before Converting the Relationship, we have to make sure each Child
Record in the Child object should be associated with the parent record. Then we
have to convert the Datatype from Lookup to Master-Detail.
Standard Relationships:
=======================
1. Account and Contact:
Note:
While removing the Account Record, all the related Contact
Records will get deleted automatically by default.
Note:
1. Upon deleting the Account Record, if the Account is
associated
with any of the Opportunity Record. Then Salesforce
won't allow you to delete the Account Record from the Object.
Note:
While removing the Account Record, if the account is associated
with any Case Record. Then Salesforce won't allows you to remove the Account record
from the object.