Configuring Rules and Business Logic

Dataform rules can trigger events, ensure that data does not become corrupt (no duplicate SSN and FEIN), and manage the requirements of a workflow, along with any number of custom functions.

You can configure rules to auto-populate another field when a value is selected. For example, let’s say that you select a Primary trigger field and a Secondary trigger field. If the values match, you can set a destination value. You have choices for operator and trigger value datatypes. For example, you can create a rule when you want to set the Implementation Specialist to X when the Payroll Specialist is Y.

To configure a rule:

  1. Go to System Admin > Advanced > Manage Rules.
    The Custom Logic Rules dashboard opens.
  2. To add a business rule, click Add.
    The Rule Details form opens.

Rule Details Window

  1. Complete the form using the following guidelines.
Table Name This is the dataform where this rule will execute when the dataform is saved.
Method Select a method. Is this rule for a field, calendar event, a date value, etc? Our example shows _SetFieldValue. Also see Business Rule Methods.
Rule Title Provide an abbreviated explanation of what this rule does, for example, "Set Implementation Specialist for Green Team".
Rule Type ClientSpace controls this field automatically. Rule Type is determined by the Method.
Description Provide a more thorough explanation of what this rule is to accomplish.

Primary Source

Select the dataform or tabbed child form to use as the source for the primary trigger evaluation.

Note: To save a Primary Source field value, you must select a corresponding trigger field, operator, and value. If you do not, the source value clears upon saving.

Secondary Source

Select the dataform, tabbed child form, Server Data Proc 1 (SDP1) or Server Data Proc 2 (SDP2) to use as the source for the secondary trigger evaluation, if applicable.

Note: To save a Secondary Source field value, you must select a corresponding trigger field, operator, and value. If you do not, the source value clears upon saving.

Primary Trigger Field

Select or type the name of the field that is going to cause the change. This field is a lookup of all the fields on the specified Primary Source form.

Secondary Trigger Field

Select or type the field name of an additional trigger condition that must be met if necessary. This field is a lookup of all the fields on the specified Secondary Source form. The lookup may include Server Data Proc 1 (SDP1) and Server Data Proc 2 (SDP2) fields. The fields appear at the bottom of the Secondary Trigger Field drop down list prefaced with SDP1 or SDP2.

Note:  Not all organizations will have SDP2 fields displayed in the list. The Server Data Procs are stored procedures that allow you to access and add fields on one dataform that reside on a different dataform. SDP1 is typically set up in the implementation phase for all customers to provide access to some fields that we feel may be helpful to most organizations. SDP2 fields are only present if custom development was requested from Professional Services that required additional access to fields.

Primary Trigger Operator

Secondary Trigger Operator

Select the operator datatype. The following operators apply to their respective datatypes:

  • Contains: Text

  • Does Not Equal: Text, Integer, Date, DateTime, Lookup, User, Parent

  • Empty: Text, Integer, Date, DateTime, Lookup, User, Parent
  • Equals: Text, Integer, Date, DateTime, Lookup, User, Parent, XML

  • Greater Than: Text, Integer, Date, DateTime, User

  • Greater Than or Equal: Text, Integer, Date, DateTime,User

  • Is Dirty: Text, Integer, Date, DateTime, Lookup, User, Parent

  • Is Dirty And Is Empty: Text, Integer, Date, DateTime, Lookup, User, Parent. Executes if the Trigger Field on this form has changed and is now empty.
  • Is Dirty And Is Not Empty: Text, Integer, Date, DateTime, Lookup, User, Parent. Executes if the Trigger Field on this form has changed and now contains a value.
  • Less Than: Text, Integer, Date, DateTime, User

  • Less Than or Equal: Text, Integer, Date, DateTime, User

  • Not Empty: Text, Integer, Date, DateTime, Lookup, User, Parent

  • Starts With: Text

  • Org, Contact, and some other special fields present as an integer and share those operators

Note:

  • If you are selecting an SDP1 or SDP2 field as the Secondary Trigger Field, be aware that the system cannot identify the datatype of an SDP1 or SDP2 field and therefore, cannot filter the Secondary Trigger Operator field to only show applicable operators for the datatype (as it currently does for regular form fields). You must evaluate the field's datatype and select a valid operator that applies to its respective datatype.

  • Is Dirty, Is Dirty And Is Empty, and Is Dirty And Is Not Empty are not available options for SDP fields.

Primary Trigger Value
Secondary Trigger Value

Type or select a value to be met as a triggering condition.

Note: Primary and Secondary trigger values are selectable from a drop down list when the associated Primary or Secondary trigger field is a HdrAction or a Lookup.

The following list is the standard behavior of the value field based on datatype:

  • Text: Shows a text field.

  • Integer: Shows an integer field.

  • Checkbox:

  • Date: Shows an integer field. You can use date settings for today (t), 1 day (1d), 1 week (1w), etc.

  • Lookup: Provides a drop-down field with the corresponding lookup values prefilled.

  • User field: Displays a list of all users.

  • Contact/org typeaheads: Integer.

  • XML: A sub-selector with the associated lookup and integer.

  • Parent field: Brings back decoded data.

  • Project User: Integer.

Other valid values include:

  • #CurrentUser: Allows you to trigger a rule when the logged in user (i.e., current user) matches the user selected user in the Trigger Field.

  • #CurrentDepartment: Allows you to trigger a rule when the logged in user's default department on their user profile matches the default department on the user profile of the selected user in the Trigger Field.

Note: 

  • To use #Current User or #CurrentDepartment, the Trigger Operator must be Equals or Does Not Equal and the Trigger Field must be a valid user data type of Project User, Project User Type Ahead, User, User by Role Type Ahead, User Filtered By Entity, User Filtered By Entity Type Ahead, User Filtered By Role, or User Type Ahead.

  • For #CurrentDepartment, if either the logged in user's default department on their user profile is not set or the default department on the user profile of the selected user in the Trigger Field is not set, the rule will not trigger. The default department must be present on both user profiles for this Trigger Value to work.

Execution Pipeline

Leave this set to Default.

Note: If you are using the Pipeline Linking table to manage Pipeline Behaviors and you are configuring a new rule, pipelines assigned a behavior of Default will auto-fill the Execution Pipeline field. If you are editing an existing rule, Execution Pipeline entries remain intact until edited. Changed entries are validated against the Pipeline Linking table. For instance, if a pipeline has been assigned a behavior of Allow or Default and you remove it, you will still be able to select it from the Execution Pipeline list. If the same pipeline is assigned a behavior of Disallow, you will not be able to add it again.

See Configuring Pipeline Linking.

Execution Order

This field controls the order in which rules will execute. Rules execute from the lowest to the highest number. It may be necessary to look at other rules already configured on this dataform to determine the order of precedence for executing rules.

Execution Order of Precedence: Within the Rules system, there is a distinct order of precedence that occurs, that being HardError, SoftError, BizLogic. This means that setting a field to a specific value automatically with BizLogic, then validating that field with a Hard Error will never occur in the correct order, as the Hard Error will fire before the BizLogic fills the field. This order of precedence happens irrespective of the execution order placed on the configured rule, so Hard Errors will fire in Execution Order least to greatest, then Soft Errors will fire in their order of execution, then the Biz Logic will happen, again in the order of execution set on each rule.

Save Action Will this rule be applied on Insert of a new dataform, the Update of an existing dataform, or on Both?

Workspace Templates

Select the templates under which this rule will run.

System

If selected, the system restricts access to only developer users for some of the rule fields.

Tags

This field indicates a tag that associates the rule with a ClientSpace feature (for example, SIDES, Pricing, PRM, or Gradient).

Note:  Global admin users can not edit the value in the Tags field if the System check box is selected.

Method Parameters

Method Parameters are dependent on the selected rule method for this rule. Hover over the info bubble for more parameter information or submit an Extranet case with your questions.

 

Note: When setting TargetField and SourceField parameters, the datatypes must either match exactly (EX: Text to Text) or be otherwise compatible (EX: Decimal to Currency). Validation occurs at Save to check for an exact or compatible datatype match. If a match is not found, a soft error message displays:  "The TargetField '<TargetField Value>' on Dataform '<Dataform Name>' may not be compatible with the SourceField '<SourceField Value>'. Do you wish to continue?"

 

The soft error allows you to continue with the Save but if you do not correct the issue, errors may occur when the rule is triggered.

  1. Click Save, Apply, or Save & New.
    Save & New clones the selected dataform from the previous rule, making it easier to add multiple rules to the same dataform.

To find the technical database names and the values stored in the database representing the value on the dataform, use a combination of Ad-hoc Reports, the Dataform Specifications Report, Lookup Admin, or Dataform Admin.

If you need further help with configuring custom rules in your system, please log a case in the Extranet.

Related Topics: