is now

Calculate the Total of an Opportunity After a Discount

Last update: June 27, 2025

Picture of Corey Wilson
Corey Wilson

Technical Writer

In this article:

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 Servis.ai 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. 

🙄

😐

😊

😍

Welcome to servis.ai Free Edition

Link your email to begin

Continue with Google

Continue with Microsoft

By continuing, you agree to servis.ai Terms of Use. Read our Privacy Policy.

Get Started with servis.ai

30-minute demo where you see servis.ai in action.

Unlock the essential servis.ai features at no cost.

How can I be of servis?
How can I be of servis?