Skip to main content
Version: 8.0

Set up business rules

Level: intermediate

Business rules control the page UI behavior and business logic. You can specify conditions and actions to take when those conditions are met. This lets you customize page behavior to better suit your needs, streamline data entry, enforce data standards, and improve data quality.

To access business rule configuration on an app page:

  1. Click in the top right → Application Hub.

  2. Open the needed app or create a custom app.

  3. Open the page or create a custom page.

  4. Click the button in the top right (Fig. 1).

    Fig. 1 Open the business rules setup page
    Fig. 1 Open the business rules setup page

View the list of business rules

You can set up business rules on the page or object level. After you set up a page-level rule, Creatio applies it to the elements only on the selected page. After you set up an object-level rule, Creatio applies it to every Freedom UI page that uses the corresponding object, including editable lists. You can set up multiple business rules for a page or object. The list of business rules is displayed on the business rules setup page (Fig. 2).

Fig. 2 List of business rules
Fig. 2 List of business rules
Important

If multiple rules affect the same page element, only the first rule is activated.

  • Click Add rule to create a new business rule.

  • Select a rule in the list and click its name to view or edit the rule.

  • Select a rule in the list and click the Enabled toggle in the setup area to turn the rule on or off (Fig. 3).

    Fig. 3 Turn on the rule
    Fig. 3 Turn on the rule
  • Select a rule in the list and click Copy to copy the rule.

  • Select a rule in the list and click Delete to delete the rule.

Show/hide an element on a Freedom UI page

You can set up a business rule that makes certain elements on record pages visible or hidden under specific conditions.

Example

Show the Sick leave, days left field on a request page for requests whose Originator type attribute is an employee.

Fig. 4 Page rule that shows/hides the element
Fig. 4 Page rule that shows/hides the element

To implement this, the Sick leave, days left field must be visible only if the value of the Originator type field is "Employee." To do this:

  1. Open the needed section (for example, the "Requests" custom app) and add a business rule.

  2. Set the filter to define the conditions that trigger the business rule in the IF block. For this example, apply the rule to requests that have the "Employee" originator type:

    1. Click Add condition. This adds a condition row.
    2. Select the "Originator Type" attribute in the new row.
    3. Leave the "=" (equal) sign as it is.
    4. Click the icon and select the "Lookup" field type in the drop-down list. This adds a lookup value field to the right.
    5. Select the "Employee" lookup value.
  3. Set up the action that implements the needed business logic in the THEN block. For this example, show the Sick leave, days left field:

    1. Click Add action → "Show elements."
    2. Select the element type to show in the Which element will be shown? block. For this example, select Input. This opens a window.
    3. Select the field to show on the page, e. g., Sick leave, days left, and click Select.
  4. Save the changes.

As a result, Creatio will show the Sick leave, days left field only for requests whose Originator type field is set to "Employee." If the Originator type field is set to any other value, Creatio will hide the Sick leave, days left field.

Make a field required or optional

You can set up a business rule that makes elements required under specific conditions.

Example

Make the Start date and Due date fields on a request page required for requests whose Type attribute is "Vacation."

Fig. 5 Page rule that makes the element required
Fig. 5 Page rule that makes the element required

To do this:

  1. Open the needed section (for example, the "Requests" custom app) and add a business rule.

  2. Set the filter to define the conditions that trigger the business rule in the IF block. For this example, apply the rule to requests that have the "Vacation" type:

    1. Click Add condition. This adds a condition row.
    2. Select the "Type" attribute in the new row.
    3. Leave the "=" (equal) sign as it is.
    4. Click the icon and select the "Lookup" field type in the drop-down list. This adds a lookup value field to the right.
    5. Select the "Vacation" lookup value.
  3. Set up the action that implements the needed business logic in the THEN block. For this example, make the Start date and Due date fields required:

    1. Click Add action → "Make elements required."
    2. Select the element type to make required in the Which element will be required? block. This opens a window.
    3. Select the fields to make required on the page, e. g., Start date and Due date, and click Select.
  4. Save the changes.

As a result, Creatio will make the Start date and Due date fields required for requests whose Type field is set to "Vacation." If the Type field is set to any other value, the fields mentioned will be optional.

Enable or disable an element

You can set up a business rule that enables or disables any page component under specific conditions. For fields, this means making them editable or read-only.

Example

Make the Owner field on a request page read-only for requests whose Status attribute is "Done" or "Canceled."

Fig. 6 Page rule that makes the element read-only
Fig. 6 Page rule that makes the element read-only

To do this:

  1. Open the needed section (for example, the "Requests" custom app) and add a business rule.

  2. Set the filter to define the conditions that trigger the business rule in the IF block. For this example, apply the rule to requests that have the "Done" or "Canceled" status:

    1. Click Add condition. This adds a condition row.
    2. Select the "Status" attribute in the new row.
    3. Leave the "=" (equal) sign as it is.
    4. Click the icon and select the "Lookup" field type in the drop-down list. This adds a lookup value field to the right.
    5. Select the "Done" lookup value.
    6. Click Add condition. This adds a condition row.
    7. Select the "Status" attribute in the new row.
    8. Leave the "=" (equal) sign as it is.
    9. Click the icon and select the "Lookup" field type in the drop-down list. This adds a lookup value field to the right.
    10. Select the "Canceled" lookup value.
  3. Set up the action that implements the needed business logic in the THEN block. For this example, make the Owner field read-only:

    1. Click Add action → "Make elements read-only."
    2. Select the element type to make required in the Which element will be read-only? block. This opens a window.
    3. Select the fields to make required on the page, for example, Owner, and click Select.
  4. Save the changes.

As a result, Creatio will make the Owner field read-only for requests whose Status field is set to "Done" or "Canceled." If the Status field is set to any other value, the field will be editable.

Apply a static filter

You can set up a business rule that will apply filter to the list of values in the lookup field. This will make the list shorter.

Example

Show only employees in the Contact lookup field for internal requests.

Fig. 8 Business rule for static filtering by lookup values
Fig. 8 Business rule for static filtering by lookup values

To do this:

  1. Open the needed section (for example, the "Requests" custom app) and add a business rule.

  2. Set the filter to define the conditions that trigger the business rule in the IF block. For this example, apply the rule to internal requests:

    1. Click Add condition. This adds a condition row.
    2. Select Attribute in the IF block → "Request category."
    3. Leave the "=" (equal) sign as it is.
    4. Select Lookup → "Internal requests."
  3. Set up the action that implements the needed business logic in the THEN block. For this example, filter the Contact field to only have employees:

    1. Click Add actionApply static filter.
    2. Select the lookup field for the static filter in the Filter field. For example, select "Contact."
    3. Click Setup filter to configure the static filter. A modal will open.
    4. Click Add condition to add a new static filter condition. A dialog box will open.
    5. Select the name of the field whose value will be used in the current static filter condition in the Column lookup. For example, select "Type" and click Select. This will close the dialog box and add a static filter condition.
    6. Click the icon to update the static filter condition. This will open a modal with the lookup values for the Type field of the Contact entity.
    7. Select all eligible checkboxes (for example, "Employee") and click Select. This will close the dialog box.
  4. Save the changes.

As a result, when the "Internal requests" lookup value is selected in the Request category field, only contacts of the Employee type will be available in the Contact field on the requests form page.

Filter lookup values based on another lookup

You can make lookup fields in forms more user-friendly and efficient by setting up filtering rules based on another lookup. When one lookup field depends on the value of another, you can configure Creatio to show only the relevant choices in the dependent field based on what was selected in the first field. You can also set the dependent field to automatically clear its current value if the filtering field changes, and autopopulate with a new value if available. These behaviors are enabled by default in Freedom UI's custom business rules, making forms more intuitive and reducing manual data entry.

Example

Filter cities by the country selected in the Country lookup field for requests that must be related to a given location.

Fig. 7 Business rule for filtering by lookup values
Fig. 7 Business rule for filtering by lookup values

To filter lookup values based on another lookup:

  1. Open the needed section (for example, the "Requests" custom app) and add a business rule.

  2. Set the filter to define the conditions that trigger the business rule in the IF block. For this example, apply the rule to requests that have the Country field filled in:

    1. Click Add condition. This adds a condition row.
    2. Click Add rule in the Requests business rules block in the left pane.
    3. Select Attribute → "Country" → "Is filled in."
    4. Select "Is filled in."
  3. Set up the action that implements the needed business logic in the THEN block. For this example, filter the City field to only have cities that are located in the current country:

    1. Click Add actionApply filter.
    2. Select the lookup field to filter in the Filter field. For this example, it is the "City" field.
    3. Select the lookup field whose value will be used to filter the other field in the By field. For this example, select "Country."
    4. Business rules created in Creatio 8.0.10 and later have automatic clearing and population of lookup values enabled by default. To disable automatic clearing, clear the Clear value... checkbox. To disable automatic population, clear the Populate value... checkbox.
  4. Save the changes.

As a result, when a "Country" lookup value is selected, the lookup options for the City field on the request page will be filtered based on the selected country.


See also

Freedom UI Designer

Create a custom app

Set up the app UI

Tech Hour: UI/ UX Building pages in Freedom UI Designer

Tech Hour: UI/ UX Best practices in Creatio