0
edits
Changes
==General Description==
Executes an expression to calculate a value and store the result.
* '''Display OrderExpression''': The order Defines the expression to be executed (relative to other fieldsadditional details on Expression found in section below) in which this field is displayed* '''Tab Name''': Displays the field under a given tab{{LabelAboveField}}* '''Field Name''': The name of the field, used internally to reference the user's input{{ToolTip}}* '''[[Caption]]''': The leading question or prologue before the field{{HideFieldForNewRecord}}* '''Searchable''': This field can be searched within the tracking application* '''Track Changes''': Keeps track of changes made to this field <u>'''Special Options for Field'''</u>{{SmartFieldView}}
==Expression Field Details==
'''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:
''ParseFloatssParseNum([Total Monthly Cost]) + ParseFloatssParseNum([Total Cost Ex]) + ParseFloatssParseNum([Hardware Rental]) + ParseFloatssParseNum([Email]) + ParseFloatssParseNum([Other])''
<pre>If you are using this field in a "Dynamic Control Field" address the fields by thier their field ids with the following syntax:
frm.cf_customfieldid.value
Example: PARSEFLOATssParseNum(frm.cf_1254625.value)*0.44
</pre>
* Calculated field formulas References to other fields are executed always enclosed in the same order that the calculated fields are displayed on the page. square brackets: [variable1]* You must not place fields that perform summary The calculations based on other calculated fields ABOVE are performed when you click the subordinate calculations. * If the fields are ordered in this manner, saving '''Save''' button and save the page will not update the summary calculation, as summary formula will be executed BEFORE the subordinate calculations are performed.
* 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===
[[Image:CS08.png]]
===String Operators===
[[Image:CS081.png]]
===Comparison Operators===
[[Image:CS084.png]]
===Date Functions===
[[Image:CS085.png]]
'''calage([date of birth])''' - Calculates the number of full years between the current date and the date included in the function.'''calage([Image:CS085date of birth],1)''' - Calculates the number of years and months between the current date and the date included in the function as a floating point.png]'''calage([date of birth],2)''' - Calculates the number of years and months between the current date and the date included 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 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===
To show the number of characters in a text field, use:
**** [''fieldname''].length
To show the number of words in a text field, use:
**** [[Category:Custom Fields''fieldname'']].split(" ").length===See Also===**** [[How Calculated Custom Fields Work]]**** [[ssParseNum]]**** [[Template Formulas/ Type Formula]] **** [[:Category:JavaScript Examples]]**** [[Variable List]]**** [[The Musings of Chin - Correct Variable Processor Use]]**** Disambiguation: [[Calculated Field|JavaScript ExamplesCalculated Field in Reporting]]{{CustomFieldPageFooter}}