Views:

Scenario Overview

In this scenario we need to compare the difference between the estimated revenue of an Opportunity vs the actual revenue generated from an opportunity. A potential error here can arise if one or more of the values are zero. We use the function ContainsDataAndNotZero to counteract this.

North52 Decision Suite Solution

The North52 Decision Suite solution works like this,

  • A formula of type ClientSide Perform Action is created so that when the Estimate Revenue or  Actual Revenue fields are filled, the formula executes.
  • The formula checks to see if the two fields contain Data
  • If they do, the formula calculates and fills in the field % of Estimate Value.

North52 Decision Suite Steps

Note: For these steps, it is presumed the field of Estimate Value has been created and that the field ActualRevenue has been added to the Opportunity form.  

Setup

  • Create a new formula of type 'ClientSide - Perform Action'
  • Set the Event to 'Create and Update'
  • Set the Source Entity to 'Opportunity'
  • For Source Property, Scroll to *** Opportunity Events *** and Ctrl click EstRevenue and Actual Revenue
  • Go to the Formula editor canvas
  • Click on the Snippets menu
  • Click on Smartflow
  • Delete everything besides Smartflow and its brackets
  • Select inside Smartflow brackets
  • Press enter twice
  • Click on Snippets 
  • Click on If
  • Delete the 'expression' placeholder text
  • Go to the Functions Tab
  • Search for "contains"
  • Shift + click the function ContainsDataAndNotZero
  • From the function wizard, click on the search icon
  • Select Actual Revenue and EstRevenue 
  • Click the Generate button
  • Highlight the true parameter and press delete and then enter
  • Go to the Function tab and search for "SetVar"
  • Click on SetVar
  • Highlight 'variablename' and replace it with ' PercentEst  '
  • Delete 'value' including the parameters
  • Go to the Source tab
  • Search for "revenue"
  • Expand the Source node
  • Click on Est. Revenue
  • Type '/' just outside of the right hand square bracket
  • From the Source node, click on Actual Revenue
  • Highlight the 'false' parameter
  • Delete it and press enter
  • Go to the Function tab and search for "SetVar"
  • Click on SetVar
  • Highlight 'variablename' and replace it with 'PercentEst'
  • Delete 'value' including the parameters
  • Replace it with 0
  • Select the empty space in the line under this function
  • Press enter twice
  • Go to the Function tab
  • Search for "updaterecord"
  • Click on UpdateRecord
  • Replace 'entityname' with 'opportunity'
  • Delete 'primarykeyid' including the parameters
  • Leave the cursor there and open up the Source tab
  • Search for "opp" and click on Opportunity
  • Delete 'attributename' and leave the cursor there
  • Open Source tab and search for "%"
  • Ctrl + click on % of Estimate Value to insert the attribute schema reference name * 
  • Delete 'attributevalue' and replace it with GetVar('PercentEst')
  • Click Save
  • The formula is now ready for testing. 

*Note this field was custom created for this example, you will need to create it or use another field. 

    Wizard - ContainsDataAndNotZero

    Please see below the wizard you can use to create the ContainsDataAndNotZero() function call used in this formula. 

    Did you know?

    North52's Data Packager helps move Portal configuration data between instances

    North52 Data Packager can be used to easily manage the transport of portal data from one instance to another. Specifically for Dynamics/PowerApps Portals, we provide templates that let you quickly move all portal entity data with ease. You can move whole sites or only the records you specify, either manually or via FetchXML queries.

    And, because we use the Solution framework for the export and import of Data Packager data, you can easily version each data package. This is especially useful if you need to build up a new dev/test portal to a specific version – just apply and execute the Data Packages you need.

    Learn more about the North52 Data Packager