General Description
Executes an expression to compute a value and stores the result.
Field Options
Option | Description | Format |
---|---|---|
Custom Field ID | The unique identifier associated with the custom field. | Not Applicable |
Field Type | The list of available Field Types. | @fieldtype@ |
Field Name | The name of the field, utilized internally to reference the user's input; | @fieldname@ |
Caption | The introductory question or prologue preceding the field. | @caption@ |
Display Order | The sequence (relative to other fields) in which this field is presented. | @displayorder@ |
Description | Definition and general description of the custom field. Will not be displayed. | @description@ |
- Expression: Specifies the expression to be executed (additional details on Expression are found in the section below)
- Label Display: Determines the position of the field caption. Options include: Left of Field, Above Field, No Caption, Hide Caption. Note: This option was previously referred to as Label Display.
- Tool Tip: When the user hovers their mouse pointer over the caption of a field, the text in this section will be displayed.
-
On New Record: Regulates how the field should be displayed until the record has been saved once.
- Always Display: The field will be visible both prior to and following the record being saved.
- Hide on New Record: The field will remain hidden until the record is saved.
- Only Show on New Record: The field will be visible until the record is saved, after which it will be hidden. This option is beneficial for fields that provide instructions for form completion before saving.
- SmartField View - Include or exclude this field from SmartField Views (@SmartFields@) or display this field exclusively for SmartField Views.
Expression Field Details
Expression: Specifies the expression to be executed.
All values are treated as strings. For arithmetic operations, the PARSEINT and PARSEFLOAT functions are employed to convert the string value to a numeric value.
Example of summing the values using five custom fields:
ssParseNum([Total Monthly Cost]) + ssParseNum([Total Cost Ex]) + ssParseNum([Hardware Rental]) + ssParseNum([Email]) + ssParseNum([Other])
If you are utilizing this field in a "Dynamic Control Field," reference the fields by their field IDs using the following syntax:
frm.cf_customfieldid.value
Example:
ssParseNum(frm.cf_1254625.value)*0.44
Options
General Options
- Searchable: This field can be searched within the tracking application.
- Track Changes: Monitors changes made to this field.
- Hide Field: The field will be concealed.
- Disable Field From Global Search: Selecting this option ensures that the contents of this field will not be displayed in Global Search results.
Formatting
- Field Formatting Options
Value Storage
- Value Storage: Facilitates linking two distinct custom fields to the same user data.
Permissions & Availability Tab
- Visibility Condition
- Field Permission Matrix
- Role - Field Permissions: These settings enable you to control, based on Role who is permitted to view and/or modify the field.
- Status - Field Permissions: These settings allow you to dictate, based on the Status of the record, whether the field can be viewed and/or modified. (Only applicable within the Universal Tracking Application)
- Type - Field Permissions: These settings allow you to control, based on the template of the record, whether the field can be viewed and/or modified. (Only applicable within the Universal Tracking Application)
Notes
- You may generally use either the name of the field within square brackets or frm.cf_customfieldid.value to reference the values for the calculations.
- In both instances, the field must be visible on the page (or a Hidden Value custom field that is present on the page).
- A Combo Box custom field can be utilized in mathematical operations as long as the stored value is numeric. The displayed value does not need to be numeric.
- Check Boxes cannot typically be used in Calculated Value fields. (They can be accommodated with sufficient knowledge of JavaScript.)
You may employ arithmetic, string, comparison operators, and functions within the calculated custom field.
- References to other fields are always enclosed in square brackets: [variable1]
- The calculations are executed when the Save button is clicked and the page is saved.
- Calculated field formulas are executed in the same order that the calculated fields are displayed on the page.
- You must not position fields that perform summary calculations based on other calculated fields ABOVE the subordinate calculations.
- If the fields are arranged in this manner, saving the page will not refresh the summary calculation, as the summary formula will be executed BEFORE the subordinate calculations are performed.
SmartSimple Calculated Field Operators
Arithmetic Operators
Rounding:
- To round a calculation to two decimal places, use the following syntax:
Math.round((expression)*100)/100
Note: To round to a different decimal place, simply modify the *100)/100 portion as required.
Example: To round to three decimal places, you would use
Math.round((expression)*1000)/1000
- For no decimal places:
Math.round(expression)
where expression is the calculation to be rounded off, such as PARSEINT([variable 1])/PARSEINT([variable 2]).
String Operators
Comparison Operators
Date Functions
calage([date of birth]) - Computes the number of full years between the current date and the date specified in the function. calage([date of birth],1) - Computes the number of years and months between the current date and the date specified in the function as a floating point. calage([date of birth],2) - Computes the number of years and months between the current date and the date specified in the function as the string "X years and Y months".
Time Functions
To calculate the time difference for Standard Fields in hours and minutes, utilize the following:
Level 1:
timediff(frm.ostartdate.value,frm.oenddate.value,frm.ostarthour.value,frm.ostartminute.value,frm.oendhour.value,frm.oendminute.value)
Level 2:
timediff(frm.startdate.value,frm.enddate.value,frm.starthour.value,frm.startminute.value,frm.endhour.value,frm.endminute.value)
(Note: the start time and end time Standard Fields are actually stored as part of the start date and end date fields, which is why they are utilized here.)
Other Functions
To display the number of characters in a text field, use:
[fieldname].length
To display the number of words in a text field, use:
[fieldname].split(" ").length