Difference between revisions of "Referential Field"

From AgileApps Support Wiki
imported>Aeric
 
imported>Aeric
 
(3 intermediate revisions by the same user not shown)
Line 3: Line 3:
has a <tt>customer</tt> field that "looks up to" to the Customer object.
has a <tt>customer</tt> field that "looks up to" to the Customer object.


Because of that lookup relationship, <tt>customer</tt> can be used to  
Because of that Lookup relationship, the <tt>customer</tt> field can be used to  
reference a field in associated Customer record. using dot notation.  
reference a field in the associated Customer record, using dot notation.  
For example:
For example:
:{|
:{|
<tt>customer.credit_rating</tt>
| <tt>customer.email</tt>
|}
|}


Here, the customer field in the current Order record points to the target
Here, the customer field in the current Order record points to the target
Customer record, and the value of the <tt>credit_rating</tt> field in  
Customer record, and the value of the <tt>email</tt> field in  
that record is used.
that record is used.


It is also possible to ''chain'' the lookup references, like this:  
It is also possible to ''chain'' the Lookup references, like this:  
:{|
:{|
<tt>customer.state.tax_rate</tt>
| <tt>customer.state.tax_rate</tt>
|}
|}


In this example, the <tt>state</tt> field in the customer object looks  
In this example, the <tt>state</tt> field in the customer object looks  
up to hypothetical tax table, where tax rates are stored. Things are
up to a hypothetical tax table, where tax rates are stored. Things are
never that simple, of course, but the example shows references can be
never that simple, of course, but the example shows references can be
chained, so long as the lookup relationships exist.
chained, so long as the Lookup relationships exist.


;Considerations:
;Considerations:
Line 28: Line 28:
:* Referential fields are available for use in these contexts:
:* Referential fields are available for use in these contexts:
::* [[Formula Fields]]
::* [[Formula Fields]]
::* [[About Policy Triggering Criteria#Triggering Criteria in Action Based Data Policies|Triggering Criteria in Action Based Data Policies]]
::* [[Data_Policy#Add_Actions_to_a_Data_Policy|Update Record Action in Data Policies]]
::* [[Validations]]
::* [[Validations]]

Latest revision as of 00:44, 12 January 2013

A referential field is a reference to a field in a related object. For example, in the Sample Order Processing System, the Order object has a customer field that "looks up to" to the Customer object.

Because of that Lookup relationship, the customer field can be used to reference a field in the associated Customer record, using dot notation. For example:

customer.email

Here, the customer field in the current Order record points to the target Customer record, and the value of the email field in that record is used.

It is also possible to chain the Lookup references, like this:

customer.state.tax_rate

In this example, the state field in the customer object looks up to a hypothetical tax table, where tax rates are stored. Things are never that simple, of course, but the example shows references can be chained, so long as the Lookup relationships exist.

Considerations
  • Referential fields can chain to arbitrary depth.
  • Referential fields are available for use in these contexts: