You can set up a business rule that will automatically populate page fields using the "Set field value" business rule. You can populate the field with a value from another field, or calculate the value dynamically, using a formula.
Populate a field with the value from another field
You can use the “Set field value” business rule to automatically populate a field with a value from another field of the current section or a field from an object linked to the current section.
To implement the logic of the example, add a “Set field value” business rule and set up its conditions:
- Open the needed section (e. g., the custom Requests section) and add a new business rule. Learn more about adding and setting up new business rules in a separate article: Set up a new business rule.
- Specify the conditions that trigger the business rule in the “IF” block of the business rule if needed. For example, to apply a “Contact is filled in” rule to the requests with the Contact field populated:
- Click Add condition. A new field appears.
- Select “Contact” in the Field field. Note that boolean fields cannot be used for setting up the condition since they are always deemed populated.
- Click the = and select is filled in in the drop-down menu.
- Set up the action that triggers the needed business logic in the “THEN” block of the business rule:
- Click Add action. In the action drop-down menu, select Set field value.
- Select the field to populate automatically in the Select field to populate field. For example, Mobile phone.
- Fill out the Specify the value to set field: click → Related objects → Contact → Mobile phone → Select.
- Click Apply → Section Wizard → Save.
As a result, if a user fills out the Contact field with a contact who has a mobile phone number, Creatio will populate the Mobile phone field of the request page with the corresponding number.
Populate a field using a formula
You can use formulas when setting up the “Set field value” business rules. This enables you to implement custom calculation logic for numeric or date field values on record pages and populate such fields automatically.
Using formulas for setting field values lets you implement advanced business logic, for example:
- calculate the product cost based on its price and the stock volume
- calculate the order sum in the base currency based on the current exchange rate and the order sum in the local currency
- calculate the actual duration of a task completion
- calculate the date of the next invoice payment, etc.
Learn more about formulas in a separate article: Formulas in business logic and pivot tables.
- Open the Products section and add a new business rule. Learn more about adding and setting up new business rules in a separate article: Set up a new business rule.
- Specify the connection fields and set the condition that triggers the business rule in the “IF” block of the business rule.
For example, to apply a “Price is filled in” and “Tax rate,% is filled in” rule to the product records with the Price and Tax rate, % fields populated:
-
Click Add condition. A new field appears.
-
Select “Price” in the Field field. Note that boolean fields cannot be used for setting up the condition since they are always deemed populated.
-
Click = and select is filled in in the drop-down menu.
-
Repeat the same settings for the Tax rate, % column.
-
- Set up the action that triggers the needed business logic in the THEN block of the business rule:
- Click Add action. In the action drop-down menu, select Set field value.
- Select the field to populate automatically in the Select field to populate field. For example, Price incl. tax.
- Fill out the Specify the value to set field: click → Formula → set up the formula in the Formula expression box that opens. Use the Parameter menu in the formula box to add numeric and date fields from the current page to your formula. For example, set up the formula for calculating the value in the Price incl. tax field based on the Price and Tax rate, % fields.
- Click Apply → Section Wizard → Save.
As a result, the Price incl. tax field on the product page will be populated with the calculated value automatically, if the Tax rate, % field value is populated.
Similarly, you can set up a formula for calculating a time period. For example, calculate task duration based on its start and end time.