Difference between revisions of "Self Reference Lookup"
imported>Aeric |
imported>Aeric Β |
||
(23 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
An [[Object]] can contain a Lookup field that references | <noinclude>__TOC__</noinclude> | ||
===About Self Reference Lookups=== | |||
An [[Object]] can contain a Lookup field that references itself (a ''self reference''). Β | |||
This configuration creates a parent-child relationships between records. | |||
Examples include: | |||
:*An organization | :*An organization could have multiple subsidiaries, and some of those might also have subsidiary companies. | ||
:*Employees have reporting relationships | :*Employees have reporting relationships to managers and subordinates. | ||
:*In manufacturing, parts in a component might have subcomponents | :*In manufacturing, parts in a component might have subcomponents or be part of of a larger component. | ||
;Considerations: | :;Considerations: | ||
A Self Reference Lookup field: | |||
::*Cannot reference itself, only other records in the object | ::*Cannot reference itself, only other records in the object | ||
::*Is not supported in {{Type}}s | ::*Is not supported in {{Type}}s | ||
Line 20: | Line 18: | ||
===Add a Self Reference Lookup Field to an Object=== | ===Add a Self Reference Lookup Field to an Object=== | ||
#Click ''' | First: | ||
#Click '''[[File:GearIcon.png]] > Customization > Objects > {object}''' | |||
#Click the ''Fields'' tab, click the '''[New Field]''' button, and complete the following information: | #Click the ''Fields'' tab, click the '''[New Field]''' button, and complete the following information: | ||
#;Label:Label to display in the form layout | #;Label:Label to display in the form layout | ||
Line 27: | Line 26: | ||
#;Field Name:Name of the field (Parent {object} is a common choice) | #;Field Name:Name of the field (Parent {object} is a common choice) | ||
#;Section:Choose a section in the form layout (default selection can be used) | #;Section:Choose a section in the form layout (default selection can be used) | ||
# | #Provide any other necessary information in the ''Basic Information'' and ''Display Attributes'' sections | ||
#Click '''[Save]''' | #Click '''[Save]''' | ||
{{Note|Whenever you create a lookup to this object in another object, you'll generally want to edit the ''Display Attributes'' section, and set the ''Record Selection Type'' to '''Hierarchical'''. You may want to do that here, as well, if you are planning to add a deep set of data (to make it easier to select the right parent). However, to select the Hierarchical option for the new self-referencing lookup field, you will have to save it first.}} | |||
Then: | |||
#Click the ''Forms'' tab | |||
#Scroll to the Related Information Section | |||
#Click the ''Display Settings'' link in the heading | |||
#Move the object labeled: ''{object} based Hierarchy View'' to the Visible Objects area | |||
#Click '''[Save]''' | |||
===Display Related Records from the Current Object=== | |||
When a Self Reference Lookup field is added, a new section is added to the [[Related Information]] section of each object [[Form]]. By default, the section is hidden. | |||
To make the related-record Hierarchy View visible: | |||
# Edit an object [[Form]] | |||
# Got to the ''Related Information'' section | |||
# Click the ''Display Settings'' link in the corner | |||
# Move the Hierarchy View from the list of Hidden Objects to the list of Visible Objects | |||
===Create a Self Reference Lookup between Records=== | ===Create a Self Reference Lookup between Records=== | ||
Line 37: | Line 51: | ||
#Edit a record, select a Parent Company from the lookup field and Save the record | #Edit a record, select a Parent Company from the lookup field and Save the record | ||
#Select the record designated as Parent Company | #Select the record designated as Parent Company | ||
# | #Save your selection. | ||
Β | |||
Β | |||
Β | |||
Β | |||
Β | |||
Latest revision as of 19:49, 24 March 2014
About Self Reference Lookups
An Object can contain a Lookup field that references itself (a self reference). This configuration creates a parent-child relationships between records.
Examples include:
- An organization could have multiple subsidiaries, and some of those might also have subsidiary companies.
- Employees have reporting relationships to managers and subordinates.
- In manufacturing, parts in a component might have subcomponents or be part of of a larger component.
- Considerations
A Self Reference Lookup field:
- Cannot reference itself, only other records in the object
- Is not supported in System Objects
- Is not supported in lookups to System Objects
- Is not supported in Object Inheritance models
- Can be deleted from the Fields tab in an Object
Add a Self Reference Lookup Field to an Object
First:
- Click > Customization > Objects > {object}
- Click the Fields tab, click the [New Field] button, and complete the following information:
- Label
- Label to display in the form layout
- Display Type
- Lookup
- Object Name
- Choose the {object} selected in the first step
- Field Name
- Name of the field (Parent {object} is a common choice)
- Section
- Choose a section in the form layout (default selection can be used)
- Provide any other necessary information in the Basic Information and Display Attributes sections
- Click [Save]
Note: Whenever you create a lookup to this object in another object, you'll generally want to edit the Display Attributes section, and set the Record Selection Type to Hierarchical. You may want to do that here, as well, if you are planning to add a deep set of data (to make it easier to select the right parent). However, to select the Hierarchical option for the new self-referencing lookup field, you will have to save it first.
Then:
- Click the Forms tab
- Scroll to the Related Information Section
- Click the Display Settings link in the heading
- Move the object labeled: {object} based Hierarchy View to the Visible Objects area
- Click [Save]
Display Related Records from the Current Object
When a Self Reference Lookup field is added, a new section is added to the Related Information section of each object Form. By default, the section is hidden.
To make the related-record Hierarchy View visible:
- Edit an object Form
- Got to the Related Information section
- Click the Display Settings link in the corner
- Move the Hierarchy View from the list of Hidden Objects to the list of Visible Objects
Create a Self Reference Lookup between Records
- Navigate to the {object} tab (Company, for example)
- Edit a record, select a Parent Company from the lookup field and Save the record
- Select the record designated as Parent Company
- Save your selection.