Relations

1. What are the relations in the salesforce?
A: A relationship is a bi-directional association between two objects. Relationships allows us to create 
links between one object and another. The platform supports following relationship types
Master-Detail
Lookup
Many-to-Many.
User To User
Esternal Lookup

2. WHAT IS MASTER DETAIL RELATION?
A: Master Detail relationship is the Parent child relationship. In which Master represents Parent and detail 
represents Child. If Parent is deleted then Child also gets deleted. Rollup summary fields can only be created 
on Master records which will calculate the SUM, AVG, and MIN of the Child records.

3. HOW MANY MASTER DETAIL FIELDS CAN BE CREATED ON THE OBJECT?
A: Up to 2 allowed to object.

4. IF WE DELETE THE PARENT RECORD WHAT WILL HAPPENS TO CHILD RECORDS?
A: Deleting parent automatically deletes child.

5. WHO IS THE OWNER OF THE CHILD RECORDS IN MASTER DETAIL RELATION?
A: Master

6. CAN CHILD RECORD BE A MASTER TO SOME OTHER OBJECT?
A: A child of one master detail relationship cannot be the parent of another.

7. CAN WE CREATE A MASTER DETAIL ON STANDARD OBJECT?
A: No We Can’t Create Master detail relation to Standard Objects, by default they are given Relations to each other.

8. WHAT IS SECURITY SHARING ON THE MASTER DETAIL RELATION?
A: The security settings for the master record control the detail and sub detail records.

9. THE CHILD RECORDS WHICH ARE DELETED WILL THEY GO TO RECYCLEBIN?
A: Deleting a detail record moves it to the Recycle Bin and leaves the master record intact; deleting a master record also deletes related detail and sub detail records. Undeleting a detail record restores it, and Undeleting a master record also undeletes related detail and sub detail records. However, if you delete a detail record and later, separately, delete its master record, you cannot undelete the detail record, as it no longer has a master record to relate to.

10. WHAT IS LOOKUP RELATION?
A: This type of relationship links two objects together, but has no effect on deletion or security. Unlike master-detail fields, lookup fields are not automatically required. When you define a lookup relationship, data from one object can appear as a custom related list on page layouts for the other object.Creates a relationship that links this object to another object. The relationship field allows users to click on a lookup icon to select a value from a popup list. The other object is the source of the values in the list.

11. HOW MANY LOOKUP RELATIONS CAN BE CREATED ON OBJECTS?
A: 25 lookup relation relationships allowed per object.

12.IF WE DELETE THE PARENT RECORD WHAT WILL HAPPENS TO CHILD RECORDS?
A: Child row not automatically deleted when a parent row is deleted. No inherited sharing.

13.CAN WE CREATE THE LOOKUP RELATION ON STANDARD OBJECT?
A: Yes

14.WHAT IS JUNCTION OBJECT OR MANY TO MANY RELATIONS?
A: By using Junction Object we can achieve Many to Many relationship, here junction object is having 
Master- Detail Relationship with different objects (Ex. Students & Courses). Using this Master to Detail Relationship, we can create the Many-to-Many Relationship in between the objects.

15. WHAT IS PRIMARY MASTER?
A: The first master-detail relationship you create on your junction object becomes the primary relationship.

16.WHAT IS SECONDARY MASTER?
A: The second master-detail relationship you create on your junction object becomes the secondary relationship.

17.WHAT IS IMPORTANCE OF PRIMARY MASTER?
A: Look and feel: The junction object's detail and edit pages use the color and any associated icon of the primary master object.Record ownership: The junction object records inherit the value of the Owner field from their associated primary master record. Because objects on the detail side of a relationship do not have a visible Owner field, this is only relevant if you later delete both master-detail relationships on your junction object.

Division: If your organization uses divisions to segment data, the junction object records inherit their division from their associated primary master record. Similar to the record ownership, this is only relevant if you later delete both master-detail relationships.

18.WHO IS THE OWNER FOR THE JUNCTION OBJECT RECORD?
A: The junction object records inherit the value of the Owner field from their associated primary master record. Because objects on the detail side of a relationship do not have a visible Owner field, this is only relevant if you later delete both master-detail relationships on your junction object.

19.IF JUNCTION OBJECT CONTAIN 200 RECORDS RELATED TO A PARENT CAN WE DELETE A CORRESPONDING PARENT?
A: In a many-to-many relationship, a user can't delete a parent record if there are more than 200 junction object records associated with it and if the junction object has a roll-up summary field that rolls up to the other parent. To delete this object, manually delete junction object records until the count is fewer than 200.

20. CAN JUNCTION OBJECT BE A PARENT TO SOME OTHER OBJECT?
A: No, Because Detail Object can’t be a parent to other Objects.

21.WHAT EXTERNAL RELATIONSHIP INTRODUCED IN SPRING15?
A: Lookup, external lookup, and indirect lookup relationships have some special behaviors and limitations.

 Only lookup, external lookup, and indirect lookup relationships are available for external objects. No other relationship types are supported.

 Indirect lookup relationship fields can be created on external objects only.

 Depending on the availability of the external system, related lists of child external objects may load slowly when users view the parent record detail pages.

 With external lookup and indirect lookup relationships, the parent record appears as a clickable link in the relationship field on the child record. If the child record is viewed by a user who doesn’t have access to the parent record, the parent record appears in the relationship field as plain text instead of a link.

 Only objects that have a custom field with the External ID and Unique attributes are available as parent objects in indirect lookup relationships. If you don't see the desired object when you create an indirect lookup relationship field, add a custom unique, external ID field to that object.

 Lookup filters aren’t available for external lookup relationship fields.

 Cascade-delete isn’t available for external object relationships.

22.RELATIONS & FIELDS FALLS UNDER WHICH PART OF MVC?
A: The Data Base Layer Model contains Object, Fields, Relationships, Apex Classes.

23.WHAT ARE ROLLUP SUMMARY FIELDS?
A: Rollup-summary fields are supported in master detail relationship. The parent object can use roll-up summary field type to perform operations of sum, maximum, minimum, count among its children records. These fields are read only fields and are used to calculate values from a set of records.

24.HOW MANY ROLLUP SUMMARY FIELDS CAN BE CREATED ON THE OBJECT?
A: Roll up summary field can only be defined on the master object. For every object only 2 Master detail relations we can create.

25.CAN WE CONVERT THE LOOK UP RELATIONSHIP TO MASTER DETAIL RELATIONSHIP? IF SO HOW CAN WE CONVERT?
A: Yes, we can convert Look-Up relationship to Master-Details Relationship. Conversion can be done only if all the fields have valid look-Up fields values only.’

26.CAN WE CREATE MASTER DETAIL RELATIONSHIP ON EXISTING RECORDS?
A: Yes, It is possible to create Master-Detail Relationship on existing record. First we have to create Look-Up relationship to a record then convert it to master-Detail Relationship.

27. IS IT POSSIBLE TO EDIT ROLL UP SUMMARY FIELD VALUE IN A RECORD?
A: No. roll up summary fields are read only fields and they can not be edited.

28.DOES AN OBJECT CAN HAVE BOTH RELATIONSHIPS (LOOKUP RELATIONSHIP &MASTER DETAIL RELATIONSHIP) AT A TIME?
A: Yes, single object can have both relationships at a time.

29.IS IT POSSIBLE TO CONVERT MASTER DETAIL TO LOOKUP RELATION?
A: If the parent object doesn’t have Rollup Summary fields for the child object then we can convert.

Comments

Post a Comment

Popular posts from this blog

Page Layouts

SOQL Scenario-1