Widget Type:
Form Widgets
TPC Version:
  • 4.0 +
rules-manager-logo

The TPC Rules manager widget let you add additional logical functionality to your form. This widget able to detect when specific action has occurred, for example; this widget able to trigger when the user changes the value of a Yes/No Field. Some of the events and actions that the widget allow to trigger are listed below.

Events

  • Is Equal To
  • Is not Equal To
  • Changes
  • Contains
  • Contains Data
  • Does NOT Contain Data
  • Window Loaded
  • Document Ready 

 Actions

  • Set Value
  • Show Field
  • Hide Field
  • Toggle Field
  • Enable Field
  • Disable Field
  • Make Required
  • Make Optional
  • Show Section
  • Hide Section
  • Toggle Section
  • Run Script

Configuration

Basic Setting 

Make sure you have a CRM Form Configuration and a TPC Form Layout attached and configured or else you won't see any fields for the widget. Set up all the field that you want to show in the form. Then drag and drop the rules manager widget to the body of the form. Click on the edit button to configure the widget.

Start by adding a title to the rule. Next, Select the field that you want to trigger the event. Select the event from the drop-down box, then select the action you would like to preform and the field. While you changing the value of the drop down boxed you can see the preview of the rule that you are building. Once you finish building your rule click on the plus button to add the rule to the rules list. 

You can add many rules as you like, once you set the rules click on save button to save all your rules.

By default, the rules manager widget detects the current field names (Logical Name) of the widget that are in the form. Typically, the widget field name can be found in its propertied tab and is located under “More Options”.

rules-manager

Widget Properties

Basic Properties

Name

Rule Name

Field

Select a Form Field from the drop down.

Event

List of Event handlers.


Is Equal To - Compares the value of the configured Field with the Value. When the 2 are equal, the configured Action will run. Not case-sensitive.

Is NOT Equal To - Compares the value of the Field with the Value. When the 2 are NOT equal, the configured Action will run. Not case-sensitive.

Changes - When the value of the configured Field changes, the configured Action will run.

Contains - Compares the value of the configured Field with the Value. When the Value is found in the Field, the configured Action will run. Not case-sensitive

Contains Data - Checks the value of the configured Field for any data. When data is found in the Field, the configured Action will run.

Does NOT Contain Data - Checks the value o
f the configured Field for any data. When NO data is found in the Field, the configured Action will run.

Window Loaded - When the 'Window Loaded' event fires, the configured Action will run.

Document Ready -When the 'Document Ready' event fires, the configured Action will run.

Action

List of Actions.

Field
Set Value -
Sets the value of the configured Field to the configured Value.
Show Field -
Shows the configured Field if hidden.
Hide Field - Hides the configured Field if visible.
Toggle Field -
Toggles the visibility of the configured Field. Shows if hidden and hides if visible.
Enable Field -
Enabled the configured field if disabled.
Disable Field - Disables the configured field if enabled.
Make Required -
Sets the configured field to be required.
Make Optional -
Sets the configured field to be optional. 

Section
Show Section- Shows the configured Section if hidden.
Hide Section - Hides the configured Section if visible.
Toggle Section - Toggles the visibility of the configured Section. Shows if hidden and hides if visible.

Sections are configured by creating and HTML element on the page or form with a class or id and setting the value of the section to be hidden as a CSS/jQuery selector. For example, if the HTML element had a class of 'myClass' then the value set would be '.myClass'. If it had an id of 'myId', then the value set would be '#myId'.

Other
Run Script - Runs the script entered into the Script field.

Value

Value you want to set. 

Rules


Rules property contains the JSON object of the rules that user defined in the front end of the widget.

EncryptGuids

The EncryptGuids advanced properties determines whether Guids should be encrypted or not. By default this is set to true.

Validator Definition


Validator Definition is set of properties which allows you to define the error messages for the validation purposes.

Advanced Properties

Advanced properties provide additional functionality. They can be accessed by clicking on the "Advanced" Button in the bottom right corner of the widget designer.

Name

Rule Name

Field

Select a Form Field from the drop down.

Event

List of Event handlers.


Is Equal To - Compares the value of the configured Field with the Value. When the 2 are equal, the configured Action will run. Not case-sensitive.

Is NOT Equal To - Compares the value of the Field with the Value. When the 2 are NOT equal, the configured Action will run. Not case-sensitive.

Changes - When the value of the configured Field changes, the configured Action will run.

Contains - Compares the value of the configured Field with the Value. When the Value is found in the Field, the configured Action will run. Not case-sensitive

Contains Data - Checks the value of the configured Field for any data. When data is found in the Field, the configured Action will run.

Does NOT Contain Data - Checks the value o
f the configured Field for any data. When NO data is found in the Field, the configured Action will run.

Window Loaded - When the 'Window Loaded' event fires, the configured Action will run.

Document Ready -When the 'Document Ready' event fires, the configured Action will run.

Action

List of Actions.

Field
Set Value -
Sets the value of the configured Field to the configured Value.
Show Field -
Shows the configured Field if hidden.
Hide Field - Hides the configured Field if visible.
Toggle Field -
Toggles the visibility of the configured Field. Shows if hidden and hides if visible.
Enable Field -
Enabled the configured field if disabled.
Disable Field - Disables the configured field if enabled.
Make Required -
Sets the configured field to be required.
Make Optional -
Sets the configured field to be optional. 

Section
Show Section- Shows the configured Section if hidden.
Hide Section - Hides the configured Section if visible.
Toggle Section - Toggles the visibility of the configured Section. Shows if hidden and hides if visible.

Sections are configured by creating and HTML element on the page or form with a class or id and setting the value of the section to be hidden as a CSS/jQuery selector. For example, if the HTML element had a class of 'myClass' then the value set would be '.myClass'. If it had an id of 'myId', then the value set would be '#myId'.

Other
Run Script - Runs the script entered into the Script field.

Value

Value you want to set. 

Rules


Rules property contains the JSON object of the rules that user defined in the front end of the widget.

EncryptGuids

The EncryptGuids advanced properties determines whether Guids should be encrypted or not. By default this is set to true.

Validator Definition


Validator Definition is set of properties which allows you to define the error messages for the validation purposes.

API

get_type()

Returns the widget type

Returns

String

get_container()

Returns the container element of the widget.     

Returns

jQuery Object     

get_model()

Returns the model object ​of the widget, which contains several useful properties related to the widget.

Returns

Object