Difference between revisions of "Formula Fields"

From AgileApps Support Wiki
imported>Aeric
imported>Aeric
Line 16: Line 16:
#;Name/Label/Title:Name of the field
#;Name/Label/Title:Name of the field
#;Return Type:Optionally, choose a [[Return Type]]
#;Return Type:Optionally, choose a [[Return Type]]
#Write an [[Expressions|Expression]] in the formula
#Write an [[Expressions|Expression]] in the formula field. Use the Expression Builder to help:
#;[Choose Field]:
#:[[File:FieldChooserButton.png|border]]
#:* Click the button to bring up a field-chooser dialog
#:;[Choose Field]:
#:* Select a field (including fields from related records)
#::* Click the button to bring up a field-chooser dialog
#:* Click '''[Insert Field]''' to insert the chosen field
#::* Select a field (including fields from related records)
#: [[File:FieldChooser.png|border‎]]
#::* Click '''[Insert Field]''' to insert the chosen field
#;Operators:
#:: [[File:FieldChooser.png|border‎]]
#:Optionally, choose an [[Operators in Formula Expressions|Operator]] to build the expression
#:;Operators:
#;Formula Functions:Choose from a list of available [[:Category:Formula Functions|Functions]]
#::Optionally, choose an [[Operators in Formula Expressions|Operator]] to build the expression
#:;Formula Functions:Choose from a list of available [[:Category:Formula Functions|Functions]]
#{{:Check Syntax}}
#{{:Check Syntax}}
#Click '''[Save]''' to insert the formula field into the form layout.<br/> Each record in this object now includes this formula field.
#Click '''[Save]''' to insert the formula field into the form layout.<br/> Each record in this object now includes this formula field.

Revision as of 18:19, 25 July 2011

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 > Data > Objects > {object} > Fields
  2. Click the [Add Field] button
  3. Choose a Field Type: Formula
    Name/Label/Title
    Name of the field
    Return Type
    Optionally, choose a Return Type
  4. Write an Expression in the formula field. Use the Expression Builder to help:
    FieldChooserButton.png
    [Choose Field]
    • Click the button to bring up a field-chooser dialog
    • Select a field (including fields from related records)
    • Click [Insert Field] to insert the chosen field
    border‎
    Operators
    Optionally, choose an Operator to build the expression
    Formula Functions
    Choose from a list of available Functions
  5. 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.
  6. 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.