Articles in this section
Formula Fields
Table of Contents
Introduction
Creating a formula means setting up a mathematical or any module-specific rule for a module to attain a specific result. Vtiger CRM lets you create formula fields for CRM modules. Once a formula field is created for a module, the formula is applied by default every time you add new records or edit old records. Formula fields are also available for Custom modules. You can create a formula field from Settings > Module Layouts & Fields settings. You can create a formula by selecting and evaluating the following:
- A module section’s fields or Vtiger Expressions or both.
- The equation (formula) to be executed.
You can create a formula for the following data types:
- Text
- Decimal
- Integer
- Percent
- Date
- Textarea
- Time
- DateTime
|
Benefits of Formula Fields
- A formula field is auto-updated for created modules.
- Facilitates quick and convenient mathematical calculations or rules.
- Saves time for users.
- Requires low implementation efforts.
Feature Availability
Click here for the availability of the Formula Fields for different editions of Vtiger CRM.
Creating Formula Fields
In this section, let us learn how to create formula fields in Vtiger CRM. In this instance, you will create the formula field, Price, for the Invoices module. You can create a formula for any module.
Follow these steps to create a formula field:
- Login to your CRM account.
- Click the User Menu.
- Click Settings on the left corner of the screen.
- Look for Module Management.
- Click Module Layouts & Fields.
- Select a module for which you want to create a formula field - Invoices.
- Select a section for which you want to create a formula field - Item Details.
- Click +Add Custom Field. This will take you to the Create Custom Field window where you can create a formula field.
- Enter or select the below information:
- Select Field Type - Select Formula.
- Label Name - Enter a name for the formula Price.
- Max digits allowed - Enter the maximum digits you want to allow for the formula field 10.
- Decimals - Enter the number of decimals you want to allow for the formula field 2.
- Value data type - Select a suitable data type for the formula field Decimal.
- Expression - Select the fields and functions to be evaluated for the formula:
- Use Field - Select the fields to be evaluated, or,
- Use Function - Select the functions to be evaluated. Or both if required.
- Enter the formula to be executed in the Expression box. For instance, we have selected the following:
1. Fields - Quantity and Unit Selling Price.
2. Function - Roundoff(field, precision). This function is used to round off
a number to the specified precision.
3. Formula - Quantity multiplied (*) by Unit Selling Price rounded off to 2
decimal values. Hence the Formula is roundoff(Quantity * Unit
Selling Price,2).
4. Follow these steps to enter the formula roundoff(Quantity * Unit
Selling Price,2):
a. Select the roundoff(field, precision) function.
b. Select Quantity, Unit Selling Price fields as field values.
c. Enter 2 as the precision value.
d. Enter Quantity * Unit Selling Price.
10. Click Save.
You have now successfully created the formula field Price for Invoices.
|
Accessing Formula Fields
In this section, let us learn how to access the formula fields you created.
Note: In this instance, we have considered the Invoices module and the Formula field, Price.
Follow these steps to access a formula field:
- Log in to the CRM.
- Go to Inventory.
- Go to Order Fulfillment.
- Go to the Invoices module.
Note: The Formula Field will reflect in new or edited records.
- Create an Invoice record with formula field details. For instance, we have created a tender record with Quantity 165 and Unit Selling Price 850.86.
- Click Save.
- Go to the Item Details section for which you have created the formula.
8. You can now view the created formula field Price in the chosen section.
|