Difference between revisions of "Custom Field Type: Special – Calculated Value"

From SmartWiki
Jump to: navigation, search
Line 45: Line 45:
 
* '''Read Only''': Checkbox
 
* '''Read Only''': Checkbox
 
* '''HTML Tag''': Additional attributes to the field HTML tag
 
* '''HTML Tag''': Additional attributes to the field HTML tag
* '''[[Custom Fields – Detailed Descriptions#Visibility Condition|Visibility Condition]]''': Conditions upon which the field is visible
+
* '''[[Visibility Condition]]''': Conditions upon which the field is visible
  
 
<u>'''Role - Field Permissions'''</u>
 
<u>'''Role - Field Permissions'''</u>

Revision as of 15:20, 22 May 2009

General Description

Executes an expression to calculate a value and store the result.

Field Options

  • Display Order: The order (relative to other fields) in which this field is displayed
  • Tab Name: Displays the field under a given tab
  • Field Name: The name of the field, used internally to reference the user's input
  • Caption: The leading question or prologue before the field
  • Searchable: This field can be searched within the tracking application
  • Track Changes: Keeps track of changes made to this field

Special Options for Field

Expression: Defines the expression to be executed

All values are treated as strings. For arithmetic operations, PARSEINT and PARSEFLOAT functions are used to convert the string value to a numeric value.

Example summing the values using five custom fields:

ParseFloat([Total Monthly Cost]) + ParseFloat([Total Cost Ex]) + ParseFloat([Hardware Rental]) + ParseFloat([Email]) + ParseFloat([Other])

If you are using this field in a "Dynamic Control Field" address the fields by thier field ids with the following syntax:
  frm.cf_customfieldid.value 

Example: PARSEFLOAT(frm.cf_1254625.value)*0.44

Note: You can in general use either the name of the field within square brackets, or frm.cf_customfieldid.value to refer to the values for the calculations.
The limitation in both cases is that the field must be visible on the page.

Services

  • Enable Map Service: displays the map icon next to the field name that will launch the user’s selected map service and display a map of the content of the field
  • Enable People Search Service: displays the search Internet icon next to the field name that will launch a variety of search services and display the contact details from those services
  • Enable Organization Search Service: displays the search Internet icon next to the field name that will launch a variety of search services and display the organisations details from those services

Field Formatting Options

  • Number Format: Formats any numbers entered into this field
  • Style: Bold, Underline, Italic, Highlight
  • Tool Tip: Enter help text to be shown on mouse-over
  • Read Only: Checkbox
  • HTML Tag: Additional attributes to the field HTML tag
  • Visibility Condition: Conditions upon which the field is visible

Role - Field Permissions

These fields allow you to control who is allowed and who is denied viewing and/or modifying the field.

Notes

You can use 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 performed when you click the Save button and save the page.

Important Notes on Calculation Order

  • Calculated field formulas are executed in the same order that the calculated fields are displayed on the page.
  • You must not place fields that perform summary calculations based on other calculated fields ABOVE the subordinate calculations.
  • If the fields are ordered in this manner, saving the page will not update the summary calculation, as summary formula will be executed BEFORE the subordinate calculations are performed.

SmartSimple Calculated Field Operators

Arithmetic Operators

CS08.png

String Operators

CS081.png

Comparison Operators

CS084.png

Date Functions

CS085.png

Time Functions

To calculate the time difference for Standard Fields in hours and minutes use 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 starttime and endtime Standard Fields are actually stored as part of the startdate and enddate fields, which is why they are used here)

Other Functions

CS086.png

See Also

How Calculated Custom Fields Work

Template Formulas

JavaScript Examples