Difference between revisions of "Formula Fields"

From AgileApps Support Wiki
imported>Aeric
imported>Aeric
Line 18: Line 18:
#: Additional options may appear, depending on the type of value you select.
#: Additional options may appear, depending on the type of value you select.
#'''Recalculate Formula Field Value''':
#'''Recalculate Formula Field Value''':
#:This option causes the value of the formula field to be calculated for every record in the object, whenever the formula changes (and when it is first added).
#:This option causes the value of the formula field to be calculated for every record in the object, whenever the formula changes, and when it is first added.
#:If this option is not selected:
#:If this option is not selected:
#::*Formula field values remain unchanged for existing records when the formula changes.
#::* Formula field values remain unchanged for existing records when the formula changes.
#::* Formula field values remain empty for existing records when the formula is added.
#::* Formula field values remain empty for existing records when the formula is added.
#{{:Expression Builder}}
#{{:Expression Builder}}

Revision as of 01:33, 8 January 2013

A formula field is a field that contains a formula (as distinct from a field that is used in a formula). Formula Fields provide the ability to calculate dynamic values using Expressions and standard Functions. Formula Fields are added to Objects via Forms.

Examples

Typical formula examples include the following calculations:

  • calculate the number of days Past Due on an invoice record
  • calculate a discount price (-5%) on orders over $1000
  • create logical tests, such as: was this record created last year? last month?
  • determine if a record is new, or changed from a prior value

For detailed examples and sample formulas, see Expressions.

To Add or Edit a Formula Field

  1. Click Designer > Objects > {object} > Fields
  2. Click the [Add Field] button
  3. Specify the Label that will appear when the field is displayed.
  4. Choose a Display Type: Formula
  5. Specify the Formula Return Type
    Additional options may appear, depending on the type of value you select.
  6. Recalculate Formula Field Value:
    This option causes the value of the formula field to be calculated for every record in the object, whenever the formula changes, and when it is first added.
    If this option is not selected:
    • Formula field values remain unchanged for existing records when the formula changes.
    • Formula field values remain empty for existing records when the formula is added.
  7. Expression Builder
  8. Click the [Check Syntax] button to ensure that you have created a valid expression. If you receive an error message, review the content and revise the expression to correct the problems.
    Field Name
    The name used to access the field value programmatically. The name is automatically generated from the label you entered. Modify it here, if desired.
  9. Click [Save] to insert the formula field into the form layout.
    Each record in this object now includes this formula field.

When the appropriate values are entered in the formula fields, the record will display the results dynamically.