Learning Sugar Logic: Calculated Commission

sugarcrmdevelopers —  June 6, 2011 — 5 Comments

Editor’s Note: This is the first post in a series of examples on how to use some of the new features added to SugarCRM in 6.1 and 6.2 powered by Sugar Logic.

Creating a commission field that is automatically recalculated based on the amount and type of opportunity is easy using SugarLogic and Calculated Fields.

We’ll start by creating a new field of type currency called “commission_c”. Once we check the “Calculated” checkbox, the “Edit Formula” button appears. Clicking the button will bring up the Formula Builder where we can enter the logic to drive our new field.

On the left we have a list of all the functions, and on the right a list of all the fields we can use in our formula. In this example, we will set the value of the commission to be 7% of the amount for “New Business”, and 5% for any other type of opportunity. The formula will be:

ifElse(equal($opportunity_type, "New Business"),
  multiply($amount, 0.7),
  multiply($amount, 0.5)

Now we just need to hit save on the Formula Builder, save again on the field editor, and finally add the field to the layouts.  If we add the field to the Edit View, the field will recalculate in real time, but it will be read only. However, we don’t have to add the field to the Edit View in order to have the field calculated.


5 responses to Learning Sugar Logic: Calculated Commission

    Rongrongmaiss June 13, 2011 at 3:29 pm

    Hey David, is Sugar Logic available for Community edition?


    Is this Blog for SUGARCRM Pro Only? if not, please DEFINE in your blog to what extent this works in other versions. Kinda rude 😛



    Yes, Sugar Logic is a feature not available in the Community Edition currently.

    Richard Cantin July 26, 2011 at 7:41 pm

    John, Sugar has the right to determine what is and is not available in SugarCRM CE.  It would be a better user experience if features that were only available in Pro/Enterprise/… were clearly identified in the material promoting the feature.  I would also put forward the suggestion that the more you enabled developer tools in the CE version, the more developer community you would encourage and the more long-term momentum you would create, but that is just my impression.  Many people start small and grow within the technology – IF they are supported when they were small.

Trackbacks and Pingbacks:

  1. Quote calculator - May 27, 2012

    […] […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s