Difference between revisions of "Layout Rules"

From AgileApps Support Wiki
imported>Aeric
m (Text replace - 'Data & Presentation > Objects' to 'Data > Objects')
imported>Aeric
Β 
(46 intermediate revisions by the same user not shown)
Line 1: Line 1:
Layout Rules provide the ability to create dynamic [[Form Layouts]] - data entry forms that adapt and offer additional options when specific data is entered: to hide/show fields based on conditions, rules and data criteria. Layout Rules guide users through a form layout so they only edit or view the information they need.
Layout Rules provide the ability to create dynamic [[Forms]] that adapt and offer additional options as data is entered.


Some examples might be: ''Show a discount button'' when an amount reaches some value, or ''Hide a section and prevent access'' to data until after a specific date and time.
===About Layout Rules===


{{permissions|Customize Objects|edit Layout Rules}}
As data is entered into a form, Layout Rules can be used to hide or show fields, buttons, and form sections, or assign an initial value to a field. They can also be used to display a message.


===How it Works===
Sample use cases:
:* ''Show a discount button'' when an amount reaches some value
:* ''Hide a section'' to prevent access to data until after a specific date and time.
Β 
====Conditions and Actions====
Layout Rules use an IF...THEN...ELSE model to customize a form layout:
Layout Rules use an IF...THEN...ELSE model to customize a form layout:


:<tt>IF some <condition> is TRUE</tt>
:<tt>IF <some condition></tt> is TRUE
::<tt>THEN do a <thing></tt>
::<tt>THEN</tt> do <some action>
:::<tt>ELSE do another <thing></tt>
::<tt>ELSE</tt> do <some other action></tt>


:Available <tt><things></tt> are any of the following actions:
:To specify a <tt><condition></tt> you use the [[Formula Builder]] to create a [Formula Expression]. That expression use record fields and fields in related fields.
:*Show/Hide Sections or Fields
: Either a <tt>THEN</tt> clause or an <tt>ELSE</tt> clause can be specified, or both.
:*Disable/Enable Fields
Β 
:*Assign Value to Fields
The possible [[#Actions|Actions]] are shown below.
:*Setup Value in Picklist
:*Display Message
:*Show/Hide Buttons


:The <tt><condition></tt> is written as a [[Formula Expressions|Formula Expression]], which can make use of most of the fields in the record, as well as some related fields. Β 
====Considerations====
:* Each Layout Rule can include multiple actions
:* Actions are executed in the order in which they are displayed
:* Actions can be added, edited, deleted or reordered
:* Sections can be opened based on a condition
:* A condition can be applied on Add, View or Update of a Record
:* To be available for use in a Layout Rule, the field must not be hidden in the layout.<br>(If it should be hidden at times, then hide it using a Layout Rule.)
:* [[Multi Object Lookup]] fields cannot be used to specify criteria for a Layout Rule.<br>''Learn more:'' [[Multi Object Lookup#Considerations]]
{{Conflicting Layout Rules and Show Empty Fields Settings}}
{{Conflicting Layout Rules and Show Empty Fields Settings}}


===Working with Layout Rules===
{{permissionRef|Customize Objects|edit Layout Rules}}
====Adding or Editing a Layout Rule====
#Click the '''[Layout Rule]''' button at the top of the page.
#Click the '''[Add New Rule]''' button to add a new Layout Rule,<br>or click the name of an existing rule to edit it.
#Fill in the layout rule settings.
#Click '''[Save]'''


====Examples====
====Settings====
<blockquote>
;Name:Name of the Layout Rule
;Enabled:Check the box to enable the Layout Rule, or uncheck it to disable the Layout Rule
;Description:Description of the rule


*In this example, the application tracks orders for Shoes and displays a VIP discount section if a premium material selected:
;Apply rule during:
:Form when the criteria is TRUE:
:Executes the Layout Rule when any of the selected actions are taken on a record in the [[Object]]
::[[File:layoutruletrue.gif|none|thumb|Condition is met: the fields in the VIP discount section can be viewed or edited]]
::*Add Record
:Form when the criteria is FALSE:
::*View Record
::[[File:layoutrulefalse.gif|none|thumb|Condition is not met: the section heading is displayed however the fields in the VIP discount section can not be viewed or changed]]
::*Update Record


*Special offer for VIP Customers:
;On Success do not continue to next Rule:
:IF Total Amount is greater than $100 USD
:Checkbox, unchecked by default
:THEN
::*If checked, and this rule is Triggered, then any rules that follow are not processed
:*Display a VIP section with special offers for VIP clients (free shipping, discounts on next purchase, etc.)
::*The order of processing rules is controlled with the [Reorder Rule] button.
:*Set the "VIP" flag to TRUE (which will add this customer to a customer service call list for follow up)
:ELSE Set Shipping amount to "Standard"


*Why was an Opportunity Lost?
;If (specify the condition...):
:IF Stage in an Opportunity record is changed to Closed/Lost
: Use the [[Formula Builder]] to define a Boolean expression that evaluates to true or false.
:THEN Display a "Reason" field
::* Optionally, specify an action to take when the expression is true
:ELSE Do nothing
::* Optionally, specify an action to take when the expression is false.
:Actions are displayed in rows which can be added, edited, deleted or reordered.


====Actions====
:*Show/Hide Sections or Fields
:*Disable/Enable Fields
:*Assign Value to Field<br>(Choose a field. Use the [[Formula Builder]] to create a value expression.)
:*Setup Value in Picklist
:*Display Message:
::* Once During Form Save Only
::* When Condition Matches
:*Show/Hide Buttons
:*Make Fields Required
:*Make Fields Not Required
</blockquote>


====Considerations====
::'''Consideration''':
:* Layout rules follow an ''IF...THEN...ELSE'' model
::The more the layout rules, the lesser the performance.
:* Each Layout Rule can include multiple actions
:* Actions are executed in the order in which they are displayed
:* Actions can be added, edited, deleted or reordered
:* Sections can be opened based on a condition
:* A condition can be applied on Add, View or Update a Record
:* [[Multi Object Lookup]] fields cannot be used to specify criteria for a Layout Rule.<br>''Learn more:'' [[Multi Object Lookup#Considerations]]


===Manage Layout Rules===
::The following table explains the '''Field Display Type''' available in the '''Add New Rule''' page and the '''Actions''' available.
#Click '''Designer > Data > Objects > {object}'''
::{| border="1" cellpadding="5" cellspacing="0"
[[File:Layoutrulelist.gif|right|thumb]]
!rowspan="2" align="center" | Field Display Types !!rowspan="2" align="Center" | Add New Rule !! align="center" colspan="8"|Actions
#Click the [[Form Layouts]] tab
|-
#Click the Layout Rule [[File:layoutruleicon.gif|link= ]] icon
! Show or Hide Sections and Fields !! Disable or Enable Fields !! Assign Value to Fields !! Setup Value in Picklist !! Display Message !! Show or Hide Buttons !! Make Fields Required !! Make Fields Not Required
#Optionally, click the ''Delete'' link to delete a Layout Rule
|-
#Optionally, click the [Reorder Rule] button to change the order that the rules are executed
|Auto Number || &#10004; || &#10004; || &#10004; || &#10005; || &#10005; || &#10004;|| &#10004;|| &#10005;|| &#10005;
#Click the [Add New Rule] button to add a new Layout Rule, or click the name of an existing rule to edit the Layout Rule[[File:layoutrule.gif|right|upright|thumb]]
|-
#;Name:Name of the Layout Rule
|Checkbox || &#10004; || &#10004; || &#10004; || &#10004; || &#10005; || &#10004;|| &#10004;|| &#10004;|| &#10004;
#;Enabled:Check the box to enable the Layout Rule, or uncheck it to disable the Layout Rule
|-
#;Description:Description of the rule
|Currency || &#10004; || &#10004; || &#10004; || &#10004; || &#10005; || &#10004;|| &#10004;|| &#10004;|| &#10004;
#;Apply rule during:Executes the Layout Rule when any the selected actions are taken on a record in the [[Object]]
|-
#:*Add Record
|Date || &#10004; || &#10004; || &#10004; || &#10004; || &#10005; || &#10004;|| &#10004;|| &#10004;|| &#10004;
#:*View Record
|-
#:*Update Record
|Date Time || &#10004; || &#10004; || &#10004; || &#10004; || &#10005; || &#10004;|| &#10004;|| &#10004;|| &#10004;
#;On Success do not continue to next Rule:Checkbox, unchecked by default
|-
#:*If checked, and this rule is Triggered, then any rules that follow are not processed
|Dependent Picklist || &#10004; || &#10004; || &#10004; || &#10005; || &#10005; || &#10004;|| &#10004;|| &#10004;|| &#10004;
#:*The order of processing rules in controlled with the [Reorder Rule] button
|-
#:Use the [[#Layout Rule Builder|Layout Rule Builder]] to create an IF, THEN, ELSE statement. This statement defines the behaviors and actions of the Layout Rule.
|Email Address || &#10004; || &#10004; || &#10004; || &#10004; || &#10005; || &#10004;|| &#10004;|| &#10004;|| &#10004;
#Click '''[Save]'''
|-
|External Lookup || &#10005; || &#10004; || &#10005; || &#10005; || &#10005; || &#10004;|| &#10004;|| &#10005;|| &#10005;
|-
|File Field || &#10005; || &#10004; || &#10004; || &#10005; || &#10005; || &#10004;|| &#10004;|| &#10004;|| &#10004;
|-
|Formula || &#10005; || &#10004; || &#10004; || &#10005; || &#10005; || &#10004;|| &#10004;|| &#10004;|| &#10004;
|-
|GeolocationΒ  || &#10004; || &#10004; || &#10004; || &#10004; || &#10005; || &#10004;|| &#10004;|| &#10004;|| &#10004;
|-
|Global Picklist || &#10004; || &#10004; || &#10004; || &#10004; || &#10004; || &#10004;|| &#10004;|| &#10004;|| &#10004;
|-
|Image Field || &#10005; || &#10004; || &#10004; || &#10005; || &#10005; || &#10004;|| &#10004;|| &#10004;|| &#10004;
|-
|Lookup || &#10005; || &#10004; || &#10004; || &#10005; || &#10005; || &#10004;|| &#10004;|| &#10004;|| &#10004;
|-
|*Lookup-Derived Field || &#10005; || &#10004; || &#10005; || &#10005; || &#10005; || &#10005;|| &#10005;|| &#10005;|| &#10005;
|-
|Multiple Checkboxes || &#10005; || &#10004; || &#10004; || &#10004; || &#10005; || &#10004;|| &#10004;|| &#10004;|| &#10004;
|-
|Multi Object Lookup || &#10005; || &#10004; || &#10004; || &#10005; || &#10005; || &#10004;|| &#10004;|| &#10004;|| &#10004;
|-
|Multi Select Picklist || &#10005; || &#10004; || &#10004; || &#10005; || &#10005; || &#10004;|| &#10004;|| &#10004;|| &#10004;
|-
|Number || &#10004; || &#10004; || &#10004; || &#10004; || &#10005; || &#10004;|| &#10004;|| &#10004;|| &#10004;
|-
|Number with decimals || &#10004; || &#10004; || &#10004; || &#10004; || &#10005; || &#10004;|| &#10004;|| &#10004;|| &#10004;
|-
|Percentage || &#10004; || &#10004; || &#10004; || &#10004; || &#10005; || &#10004;|| &#10004;|| &#10004;|| &#10004;
|-
|Phone/Fax || &#10004; || &#10004; || &#10004; || &#10004; || &#10005; || &#10004;|| &#10004;|| &#10004;|| &#10004;
|-
|Picklist || &#10004; || &#10004; || &#10004; || &#10004; || &#10004; || &#10004;|| &#10004;|| &#10004;|| &#10004;
|-
|Radio Buttons || &#10004; || &#10004; || &#10004; || &#10004; || &#10005; || &#10004;|| &#10004;|| &#10004;|| &#10004;
|-
|Rich Text Area || &#10005; || &#10004; || &#10005; || &#10005; || &#10005; || &#10004;|| &#10004;|| &#10004;|| &#10004;
|-
|Text Area || &#10004; || &#10004; || &#10004; || &#10004; || &#10005; || &#10004;|| &#10004;|| &#10004;|| &#10004;
|-
|Text Field || &#10004; || &#10004; || &#10004; || &#10004; || &#10005; || &#10004;|| &#10004;|| &#10004;|| &#10004;
|-
|Time || &#10004; || &#10004; || &#10004; || &#10004; || &#10005; || &#10004;|| &#10004;|| &#10004;|| &#10004;
|-
|URL || &#10004; || &#10004; || &#10004; || &#10004; || &#10005; || &#10004;|| &#10004;|| &#10004;|| &#10004;
|-
|Rollup Summary || &#10004; || &#10004; || &#10004; || &#10005; || &#10005; || &#10004;|| &#10004;|| &#10005;|| &#10005;
|}


===Layout Rule Builder===
{{Note|Lookup-Derived fields cannot be created manually by the user. To configure lookup-derived fields, see [[Lookup-Derived Fields]].}}
[[File:fieldsinformulas.gif|right|upright|thumb]]The Layout Rule Builder has three sections:
:;IF Section:Specify the condition that will trigger this rule
:::*Create a [[Formula Expressions|Formula Expression]] (using <tt><FIELD_NAME> <OPERATOR> <FUNCTION></tt>) that evaluates to a TRUE/FALSE state
:::*The contents of the Field list may differ based on the object
::*If the condition resolves to TRUE, take the action associated with the THEN condition
::*If the condition resolves to FALSE, take the action associated with the ELSE condition
:;THEN Section:Optionally, create action(s) to take when the expression is TRUE; Actions are displayed in rows which can be added, edited, deleted or reordered
:;ELSE Section:Optionally, create action(s) to take when the expression is FALSE; Actions are displayed in rows which can be added, edited, deleted or reordered


===Available Actions===
====Reorder Layout Rules====
{{:Layout Rules Actions}}
#Click the '''[Layout Rule]''' button at the top of the page.
#Click the '''[Reorder Rule]''' button to change the order in which rules are executed.


===Using Enumerated Picklists in Layout Rules===
====Using Enumerated Picklists in Layout Rules====
Layout Rule criteria can be specified using Enumerated Picklist Values. The Display Label is not considered valid for criteria in Layout Rules.
Layout Rule criteria can be specified using Enumerated Picklist Values. The Display Label is not considered valid for criteria in Layout Rules.

Latest revision as of 09:37, 26 May 2020

Layout Rules provide the ability to create dynamic Forms that adapt and offer additional options as data is entered.

About Layout Rules

As data is entered into a form, Layout Rules can be used to hide or show fields, buttons, and form sections, or assign an initial value to a field. They can also be used to display a message.

Sample use cases:

  • Show a discount button when an amount reaches some value
  • Hide a section to prevent access to data until after a specific date and time.

Conditions and Actions

Layout Rules use an IF...THEN...ELSE model to customize a form layout:

IF <some condition> is TRUE
THEN do <some action>
ELSE do <some other action>
To specify a <condition> you use the Formula Builder to create a [Formula Expression]. That expression use record fields and fields in related fields.
Either a THEN clause or an ELSE clause can be specified, or both.

The possible Actions are shown below.

Considerations

  • Each Layout Rule can include multiple actions
  • Actions are executed in the order in which they are displayed
  • Actions can be added, edited, deleted or reordered
  • Sections can be opened based on a condition
  • A condition can be applied on Add, View or Update of a Record
  • To be available for use in a Layout Rule, the field must not be hidden in the layout.
    (If it should be hidden at times, then hide it using a Layout Rule.)
  • Multi Object Lookup fields cannot be used to specify criteria for a Layout Rule.
    Learn more: Multi Object Lookup#Considerations

Notepad.png

Note:
A field can be referenced in either:

a. A section for which Show Empty Fields in View has been disabled
    (using Advanced Options in a Section), or
b. A Layout Rule condition.

But it cannot be referenced in both places.

The Reason: If the field is empty, the server removes it from the page. The Layout Rule, meanwhile, is a JavaScript function in the page. When the Layout Rule tries to test that field, an error occurs.

Working with Layout Rules

Lock-tiny.gif

Users that have the Customize Objects permission can edit Layout Rules. 

Adding or Editing a Layout Rule

  1. Click the [Layout Rule] button at the top of the page.
  2. Click the [Add New Rule] button to add a new Layout Rule,
    or click the name of an existing rule to edit it.
  3. Fill in the layout rule settings.
  4. Click [Save]

Settings

Name
Name of the Layout Rule
Enabled
Check the box to enable the Layout Rule, or uncheck it to disable the Layout Rule
Description
Description of the rule
Apply rule during
Executes the Layout Rule when any of the selected actions are taken on a record in the Object
  • Add Record
  • View Record
  • Update Record
On Success do not continue to next Rule
Checkbox, unchecked by default
  • If checked, and this rule is Triggered, then any rules that follow are not processed
  • The order of processing rules is controlled with the [Reorder Rule] button.
If (specify the condition...)
Use the Formula Builder to define a Boolean expression that evaluates to true or false.
  • Optionally, specify an action to take when the expression is true
  • Optionally, specify an action to take when the expression is false.
Actions are displayed in rows which can be added, edited, deleted or reordered.

Actions

  • Show/Hide Sections or Fields
  • Disable/Enable Fields
  • Assign Value to Field
    (Choose a field. Use the Formula Builder to create a value expression.)
  • Setup Value in Picklist
  • Display Message:
  • Once During Form Save Only
  • When Condition Matches
  • Show/Hide Buttons
  • Make Fields Required
  • Make Fields Not Required
Consideration:
The more the layout rules, the lesser the performance.
The following table explains the Field Display Type available in the Add New Rule page and the Actions available.
Field Display Types Add New Rule Actions
Show or Hide Sections and Fields Disable or Enable Fields Assign Value to Fields Setup Value in Picklist Display Message Show or Hide Buttons Make Fields Required Make Fields Not Required
Auto Number
Checkbox
Currency
Date
Date Time
Dependent Picklist
Email Address
External Lookup
File Field
Formula
Geolocation
Global Picklist
Image Field
Lookup
*Lookup-Derived Field
Multiple Checkboxes
Multi Object Lookup
Multi Select Picklist
Number
Number with decimals
Percentage
Phone/Fax
Picklist
Radio Buttons
Rich Text Area
Text Area
Text Field
Time
URL
Rollup Summary

Notepad.png

Note: Lookup-Derived fields cannot be created manually by the user. To configure lookup-derived fields, see Lookup-Derived Fields.

Reorder Layout Rules

  1. Click the [Layout Rule] button at the top of the page.
  2. Click the [Reorder Rule] button to change the order in which rules are executed.

Using Enumerated Picklists in Layout Rules

Layout Rule criteria can be specified using Enumerated Picklist Values. The Display Label is not considered valid for criteria in Layout Rules.