Difference between revisions of "Layout Rules"

From LongJump Support Wiki
imported>Aeric
imported>Aeric
m (Text replace - '{{permissions|Customize Objects|' to '{{permissionRef|Customize Objects|')
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''Designer > Objects > {object} > Forms > {form} > [Layout Rules]'''
'''Designer > Objects > {object} > Forms > {form} > [Layout Rules]'''


Layout Rules provide the ability to create dynamic [[Forms]] - 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 or entire sections of a form.
:* Disable or enable fields
:* Assign a value to a field
:* Hide or show values in a Picklist
:* Hide or show values a Button
:* 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.
 
===Working with Layout Rules===
 
{{permissionRef|Customize Objects|edit Layout Rules}}


===How it Works===
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:


Line 13: Line 26:
::<tt>THEN do a <thing></tt>
::<tt>THEN do a <thing></tt>
:::<tt>ELSE do another <thing></tt>
:::<tt>ELSE do another <thing></tt>
:Available <tt><things></tt> are any of the following actions:
:*Show/Hide Sections or Fields
:*Disable/Enable Fields
:*Assign Value to Fields
:*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.  
: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.  
{{Conflicting Layout Rules and Show Empty Fields Settings}}


 
;Considerations:
====Examples====
 
*In this example, the application tracks orders for Shoes and displays a VIP discount section if a premium material selected:
:Form when the criteria is TRUE:
::[[File:layoutruletrue.gif|none|thumb|Condition is met: the fields in the VIP discount section can be viewed or edited]]
:Form when the criteria is FALSE:
::[[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]]
 
*Special offer for VIP Customers:
:IF Total Amount is greater than $100 USD
:THEN
:*Display a VIP section with special offers for VIP clients (free shipping, discounts on next purchase, etc.)
:*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 Stage in an Opportunity record is changed to Closed/Lost
:THEN Display a "Reason" field
:ELSE Do nothing
 
 
====Considerations====
:* Layout rules follow an ''IF...THEN...ELSE'' model
:* Each Layout Rule can include multiple actions
:* Each Layout Rule can include multiple actions
:* Actions are executed in the order in which they are displayed
:* Actions are executed in the order in which they are displayed
:* Actions can be added, edited, deleted or reordered
:* Actions can be added, edited, deleted or reordered
:* Sections can be opened based on a condition  
:* Sections can be opened based on a condition  
:* A condition can be applied on Add, View or Update a Record
:* 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]]
:* [[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}}


===Manage Layout Rules===
====Adding or Editing a Layout Rule====
#Click '''Designer > Data > Objects > {object} > Forms'''  
#Click '''Designer > Objects > {object} > Forms > {form} View'''  
[[File:Layoutrulelist.gif|right|thumb]]
#Click the '''[Layout Rule]''' button at the top of the page.
#Click the '''[Layout Rule]''' button.
#Click the '''[Add New Rule]''' button to add a new Layout Rule,<br>or click the name of an existing rule to edit it.
#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
#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
#;Name:Name of the Layout Rule
#;Enabled:Check the box to enable the Layout Rule, or uncheck it to disable 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
#;Description:Description of the rule
#;Apply rule during:Executes the Layout Rule when any the selected actions are taken on a record in the [[Object]]
#;Apply rule during:Executes the Layout Rule when any of the selected actions are taken on a record in the [[Object]]
#:*Add Record
#:*Add Record
#:*View Record
#:*View Record
Line 72: Line 52:
#;On Success do not continue to next Rule:Checkbox, unchecked by default
#;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
#:*If checked, and this rule is Triggered, then any rules that follow are not processed
#:*The order of processing rules in controlled with the [Reorder Rule] button  
#:*The order of processing rules is 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.  
#: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.  
#Click '''[Save]'''
#Click '''[Save]'''


===Layout Rule Builder===
====Reorder Layout Rules====
[[File:fieldsinformulas.gif|right|upright|thumb]]The Layout Rule Builder has three sections:
#Click '''Designer > Objects > {object} > Forms > {form} View'''
#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.
 
====Layout Rule Builder====
The Layout Rule Builder has three sections:
:;IF Section:Specify the condition that will trigger this rule
:;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
:::*Create a [[Formula Expressions|Formula Expression]] (using <tt><FIELD_NAME> <OPERATOR> <FUNCTION></tt>) that evaluates to a TRUE/FALSE state
Line 86: Line 71:
:;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
:;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===
====Available Actions====
{{:Layout Rules Actions}}
{{:Layout Rules Actions}}


===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 00:10, 23 October 2012

Designer > Objects > {object} > Forms > {form} > [Layout Rules]

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 or entire sections of a form.
  • Disable or enable fields
  • Assign a value to a field
  • Hide or show values in a Picklist
  • Hide or show values a Button
  • 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.

Working with Layout Rules

Lock-tiny.gif

Users that have the Customize Objects permission can edit Layout Rules 

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

IF some <condition> is TRUE
THEN do a <thing>
ELSE do another <thing>
The <condition> is written as a 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.
    (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.

Adding or Editing a Layout Rule

  1. Click Designer > Objects > {object} > Forms > {form} View
  2. Click the [Layout Rule] button at the top of the page.
  3. Click the [Add New Rule] button to add a new Layout Rule,
    or click the name of an existing rule to edit it.
    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
    Use the Layout Rule Builder to create an IF, THEN, ELSE statement. This statement defines the behaviors and actions of the Layout Rule.
  4. Click [Save]

Reorder Layout Rules

  1. Click Designer > Objects > {object} > Forms > {form} View
  2. Click the [Layout Rule] button at the top of the page.
  3. Click the [Reorder Rule] button to change the order in which rules are executed.

Layout Rule Builder

The Layout Rule Builder has three sections:

IF Section
Specify the condition that will trigger this rule
  • Create a Formula Expression (using <FIELD_NAME> <OPERATOR> <FUNCTION>) 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

Available actions include:

  • Show/Hide Sections or Fields
  • Disable/Enable Fields
  • Assign Value to Fields
  • Setup Value in Picklist
  • Display Message:
  • Once During Form Save Only
  • When Condition Matches
  • Show/Hide Buttons

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.