Let’s create a Calculated Field that calculates the Total of an Opportunity After a Discount.
Note: The App you create this Calculated Field in can vary based on your FreeAgent setup. We are using the Opportunities App for our example but a Deals or Products App works just as well.
To create this Calculated Field we will need the following fields in the Opportunity App:
- Opportunity Amount- A Currency Field that contains the value of the opportunity.
- Discount Amount- A Percent Field that contains the value of the discount.
See How to create a new form field for more.
Begin by naming the Calculated Field and selecting what Section of the Opportunities App the Calculated Field will be displayed in (the choices will depend on your setup).
Next, click the Show Advanced Settings box and change the Calculated field to Yes.
Now, select script Calculation Type. Enter the following code snippet into the Script window:
(function(opportunity_fa){
return (opportunity_fa.amount * opportunity_fa.discount);
}(opportunity));
Your fields may have different names. Replace the bold field names in the code snippet with the names of your fields.
Save the Calculated Field.