Adding Calculated Fields
With a calculated field, you can specify a formula for dynamically computing a value for a text, numeric, date, or values list field.
On this page
Before you begin
Complete the process for adding a date, numeric, text, cross-reference, or values list field.
- Adding Date Fields
- Adding Numeric Fields
- Adding Text Fields
- Adding Cross-Reference Fields
- Adding Values List Fields
Task 1: Make the field calculated
- From your application, go to Designer tab > Layout tab > Objects panel.
- Select the field.
- In the Properties panel > Options section, select Make this a calculated field.
Important: If you select Calculated Field and save this change for a field in which user-entered values have already been entered, all values written to that field are deleted across all records in the application and are replaced with calculated values. Conversely, if you clear the Calculated Field checkbox for a field in which calculated values have already been saved, those calculated values are retained in the database.
Task 2: Build the formula
You can edit a formula directly in the Formula field or the function and operations to insert the proper syntax.
- In the Calculation Properties section, click
to open the Formula Builder.
- Scroll down to Functions & Operators, select the functions and operators (1 at a time) that you want to use in the formula.
- Do 1 or more of the following:
- To include a field reference as a parameter for the formula, click the field in the Available Fields list.
- To include a field-value reference from a Values List field as a parameter for the formula, expand the appropriate field node in the Available Fields list and select the value. The value is added to your formula within the "VALUEOF" function.
Note: If you select a field value to reference in your formula and that value is later modified in the values list, the field-value reference in your formula is automatically updated to reflect the modified value.
- When you finish creating the formula, click Validate in the top-right corner of the formula.
If the validation process encounters an error in the formula, a message displays that describes the error or alerts you that the formula contains an unknown error. The validation process only identifies 1 error at a time, even if the formula contains multiple errors. If you get an error message, correct the error and click Validate again. If you get another error message, correct that error as well. Continue this process until the formula passes the validation process.
- Click Save.
Task 3: Define the recalculation behavior
- Go to the Calculation Properties section.
-
In the Recalculation field, select behavior for recalculating field values.
The following table describes the options. Field
Description
As Needed
Formulas are recalculated when a dependent field in the formula changes.
Always
Formulas are recalculated every time content is saved even though a field is not referenced in the formula. Formulas that contain NOW() and TODAY() functions, or user first name, last name, and middle name (Editor) parameters are recalculated regardless of content change.
Task 4: Define the error handling behavior
- Go to the Calculation Properties section.
-
In the Error Handling field, select rules for handling errors.
The following table describes the options. Field
Description
Display Error
Displays the word Error as a link when a calculation error occurs. Users with the appropriate access privileges can click the link to open the Calculation Error page where the error is explained.
Use No Value
Saves an empty value in the field when a calculation error occurs.
Use Specific Value
Saves a specific value in the field when a calculation error occurs
Task 5: Set configuration options
In the Configuration section, if the field is a Numeric field, set the following options:
Option |
Description |
---|---|
Decimal places |
Specifies the number of decimal places required for values entered in the field (maximum 6). Entering a value in the numeric field with fewer decimal places than the required number pads the value with zeros. For example, if you require 3 decimal places and you then enter a value of "4.1" in the field, the value displays as "4.100" when you save the record. On the other hand, if you enter a value in the field with more decimal places than the required number, you must limit the number of decimal places in the value to fit the field requirements before you can save the record. |
Negative display |
Specifies how the negative numbers display. Options include:
|
Prefix |
Specifies the text (up to 10 characters) that appears in front of the numeric value. For example, when you enter "ABC" in this field, record displays "ABC123456." |
Suffix |
Specifies the text (up to 10 characters) that appears after the numeric value. For example, entering "miles" labels the field value as a measurement of distance. For the tracking ID, you enter "XYZ" in this field. The tracking ID value for a record displays "123456XYZ." |
Task 6: Configure help text
Field-level help provides additional guidelines and instructions to ensure users enter appropriate information in the field. This Help text displays for users when they add, edit, and view records in the application where the field resides.
Consider the following general guidelines when writing field-level Help:
- Use short, concise instructions that direct the user to take a specific action. For example, "Enter your name" is preferable to "This field is used to enter your name."
- Use complete sentences whenever possible.
- Avoid jargon (unless terms are critical and are familiar to your users).
- Consider the technical aptitude of your audience, and author your help text at a corresponding level.
- Use “you” and “your” as if you are speaking directly to the user.
- Consider posing Help text in the form of a question, for example, "What is your level of interest?"
In the Help text section, do the following:
- Select a display option for both edit and view modes.
- If you are using help text, enter the text.
Option |
Description |
---|---|
None |
Help text does not display. |
Tooltip Icon |
Help icon displays beside the field in edit and view modes. Click this icon to display the field Help. The application dynamically sizes of the Help box based on the number of characters in the text.
|
Below |
Help displays below the field in edit and view modes.
|
Task 7: Configure field access
Access rights determine whether all users or only select users or groups have access to the field.
In the Access section, do the following:
- Select Public or Private.
- If you selected Private, maximize the pane and click
to select the users and groups to whom you want to grant access.
Note: Key fields must be public.