How to create Formula fields?
In this section let us learn how to create formula fields in Vtiger CRM.Note: For instance, we are creating 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.
- Value data type - Select a suitable data type for the formula field Decimal.
- 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.
- Expression - This allows you to 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: - Fields - Quantity and Unit Selling Price.
- Function - roundoff(field,precision). This function is used to round off a number to the specified precision.
- Formula - Quantity multiplied (*) by Unit Selling Price rounded off to 2 decimal values. Hence the Formula is roundoff(Quantity * Unit Selling Price,2).
- Follow these steps to enter the formula roundoff(Quantity * Unit Selling Price,2):
- Select roundoff(field,precision) function.
- Select Quantity, Unit Selling Price fields as field values.
- Enter 2 as precision value.
- Enter Quantity * Unit Selling Price.
- Click Save.
You have now successfully created the formula field Price for Invoices. Note: Once you create a formula field for a module, the created formula field will be applied only to the following: - New records created and saved from then on.
- Old records that are edited.
|