Difference between revisions of "Self Reference Lookup"

From AgileApps Support Wiki
imported>Aeric
m (Text replace - 'Designer > Objects' to 'File:GearIcon.png > Customization > Objects')
imported>Aeric
Β 
Line 1: Line 1:
An [[Object]] can contain a Lookup field that references the Object itself (i.e. a self reference). This configuration is used to build record hierarchies (parent-child relationships between records) which are displayed in a [[Related Information]] section.
<noinclude>__TOC__</noinclude>
__TOC__
===About Self Reference Lookups===
===About Self Reference Lookups===
A self-reference lookup creates a hierarchical record structure. That hierarchy can be used to make it easier for a user to find the record they're looking for:
An [[Object]] can contain a Lookup field that references itself (a ''self reference'').
This configuration creates a parent-child relationships between records.


:[[File:SelfReferenceLookup-Hierarchy.png]]
Examples include:
Β 
:*An organization could have multiple subsidiaries, and some of those might also have subsidiary companies.
Here, for example, a designer is adding a new element to a list of sizes (Womens XX-Small). When the designer clicks the [[Lookup]] icon next to the Category field, a window opens that displays the existing records in a tree.
:*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.
When taking an order for a T-shirt, for example, an order-entry clerk might select "Boys Medium". But here, the designer is adding a new record, so the selection is the category (Womens).
Β 
When the records are shown in a list view, they look pretty much like any other records:
:{| border="1"Β  cellpadding="3" class="tight-rows"
! align="left"|Selection !! Category
|-
| Boys || None
|-
| Boys Small &nbsp; &nbsp; || Boys
|-
| etc. ||
|}
But when the records are displayed for a Lookup selection, the hierarchy becomes apparent.
Other examples include:
:*An organization might have multiple subsidiaries, and some of those companies 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:
:;Considerations:
Line 56: Line 38:
#Click '''[Save]'''
#Click '''[Save]'''


===Display Related Records from the Current Object in a Hiearchy ===
===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]]:
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.
:*The new section is named: ''<tt><field></tt> based Hierarchy View'', where ''<field>'' is the self reference [[Lookup]] field. Β 
:*By default, the section is hidden
:*When visible, this section displays the hierarchy of records that have the current record as the root.
Β 
These two diagrams display the difference between a normal related-record list and a related-record hierarchy:
{| border="1"
! Related Record List !! Related Record Hierarchy
|-
| [[File:SelfReferenceLookup-RelatedRecords.png]] || [[File:SelfReferenceLookup-RelatedHierarchy.png]]
|}
Β 
On the left is the normal list of related records from the "Boys" record in the Size object. The list shows all of the records that are directly related (Boys Large, Boys Medium, and so on).
Β 
On the right is the Hierarchy View--a tree. At the topmost level, that list shows the same records as the view on the left. But here, any entries to that look up to those records can be viewed by clicking on the '''[+]''' icons in the tree. So the entire subtree rooted at the current record (node) is available for inspection.


To make the related-record Hierarchy View visible:
To make the related-record Hierarchy View visible:
Line 83: 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
#Scroll down to the Company based Hierarchy View section
#Save your selection.
::Note that child Companies are displayed in the tree, demonstrating the relationships between records in the Company object
Β 
===Edit an Object based Hierarchy View===
Β 
To edit an <object> based Hierarchy View:
#Click '''[[File:GearIcon.png]] > Customization > Objects '''
#Navigate to the object of interest
#In the Forms tab, navigate to the ''Related Information'' section
#Navigate to the ''<object> based Hierarchy View'', click the Edit Related Information [[File:Editlayouticon.gif|link= ]] icon
#:[[File:Objectbasedhierarchyview.gif]]
#Fill in the Object based Hierarchy View settings.
#Click '''[Save]'''<br>TheΒ  <object> based Hierarchy View records are displayed in the Related Information section.
Β 
;Object based Hierarchy View Settings:
:;Title:Title of the Related Information section
::*Pre-populated with ''<object> based Hierarchy View''
::*Optionally, change the Title
:;Fields to Display:Select fields in the list of those Available, and click the right-arrow button to move them to the Selected column; Optionally, click the up- or down-arrow buttons to change the order in which the fields appear
:;Sort By: Choose a field to determine the sort order of the records, and choose either Descending or Ascending order
:;Additional Sort By:Optionally, choose a second-level sort
::*Choose a field to determine the sort order of the records, and choose either Descending or Ascending order
:;Display Type:Choose from Tree or Tabular; Tree is default
::<table> <tr><td valign="top">[[File:treeselflookup.gif|none|frame|Tree]]</td> <td>&nbsp;</td> <td valign="top">[[File:tabularselflookup.gif|none|frame|Tabular]]</td> </tr></table>
::*If Display Type is Tree, the Mode Type option is displayed
::*'''Mode Type -''' Collapsed or Expanded; Collapsed is default
:;Scrolling Window Size: Define the number of rows to display by selecting a Scrolling Window Size; Choose from:
::*No Scrolling, Show all Rows
::*5 Records, Scroll Window
::*10 Records, Scroll Window
::*20 Records, Scroll Window
::*30 Records, Scroll Window
::*40 Records, Scroll Window
::*50 Records, Scroll Window
Β 
===Delete an Object based Hierarchy View===
Β 
To Delete an Object based Hierarchy View, delete the field that is associated with this Related Information Section.
{{:Delete a Field}}

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:

Add a Self Reference Lookup Field to an Object

First:

  1. Click GearIcon.png > Customization > Objects > {object}
  2. 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)
  3. Provide any other necessary information in the Basic Information and Display Attributes sections
  4. Click [Save]

Notepad.png

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:

  1. Click the Forms tab
  2. Scroll to the Related Information Section
  3. Click the Display Settings link in the heading
  4. Move the object labeled: {object} based Hierarchy View to the Visible Objects area
  5. 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:

  1. Edit an object Form
  2. Got to the Related Information section
  3. Click the Display Settings link in the corner
  4. Move the Hierarchy View from the list of Hidden Objects to the list of Visible Objects

Create a Self Reference Lookup between Records

  1. Navigate to the {object} tab (Company, for example)
  2. Edit a record, select a Parent Company from the lookup field and Save the record
  3. Select the record designated as Parent Company
  4. Save your selection.