SugarCRM enables businesses to create calculated fields that produce dynamic values through formulas created in the Studio function of Sugar. This enables businesses to easily create fields that provide benefits like performing mathematical processes and streamlining data entry. The example provided in this blog will show you how to produce a calculated field that provides the weighted amount of an opportunity based on a weighted probability system that takes into account where an opportunity is in a business's sales process.  

Weighted Probability

Before we begin creating our calculated field, let’s briefly discuss the purpose of the field that is the subject of this blog. When an opportunity is entered into Sugar, there is a revenue amount that is associated with the opportunity. In order to improve the accuracy of forecasting, some businesses use what is called a weighted probability to better predict revenue generation. Weighted probability is essentially a percentage that is associated with the likelihood of winning an opportunity. In our calculated field, the weighted probability is based on where the opportunity is in the sales cycle. For example, if the opportunity is in the early stages of a business’s sales process, a lower percentage would be associated with the opportunity, and therefore, the revenue associated with the opportunity will be lower. However, as the opportunity advances to different sales stages and is closer to being won, the percentage associated with the opportunity increases. (e.g. 10% - Prospect, 20% - Needs Analysis, 30% - Value Proposition, etc.)  

Creating A Calculated Field In Sugar

The first step that we’ll take in creating our calculated field is logging into SugarCRM as an admin user and accessing the Dropdown Editor from the Administration page using the navigation: Admin>Developer Tools Section>Dropdown Editor.   In the Dropdown Editor, we’ll create a dropdown list to represent the weighted probability percentages. Dropdown-Editor   After the dropdown list is created, the next step will be to create the dropdown field to associate with the dropdown list. To create the dropdown list we will navigate to: Studio>Opportunities>Fields and select the Add Fields button. From here, we will be taken to the Edit Field page where the field can be created. This field will be given the field name “probpercent_c” and the display label “Probability Percentage”. Dropdown-Field   Next, we will create a hidden decimal field that will allow the dropdown field to be calculated. We will give this field a calculated value and simply select our dropdown field in the Formula Builder by selecting the Field Name (probpercent_c). Decimal-Field   The last field we create is our calculated field that will produce the value of the weighted probability amount. To produce this value, we will use a formula that multiplies the amount an opportunity is worth by the weighted probability percentage. The formula is represented in our field as: multiply($amount, $probabilitycast_c) Formula   Now that all of our fields have been created, we will need to add the fields to the Record View layout of the Opportunities module. To do this, we will access the Record View layout in Studio by navigating to Studio>Opportunities>Layouts>Record View. From here, we will add the two fields “Probability Percentage” and “Weighted Amount” to the layout. Record-View-Layout   After the fields are added, select Save and Deploy to view the calculated field in the Opportunities Module. In the record view of an Opportunity, we can see:

  • The Opportunity Amount
  • The Probability Percentage
  • The Weighted Amount (calculated field)

Opportunity-Record-View   To learn more about calculated fields in SugarCRM, check out our Calculated Fields Guide. Atcore Systems' Calculated Fields Guide is a document that provides a comprehensive overview of creating calculated fields in Sugar.

book_cover-e1431720114425Download the free eBook Why IT Loves Sugar!

Why I.T. Loves Sugar presents real world examples and use cases that display the many ways SugarCRM provides solutions for businesses. [otw_shortcode_button href="" size="medium" icon_position="left" shape="radius" target="_blank"]Download Now[/otw_shortcode_button]