Views:

Scenario Overview 

In this scenario, we want our all Users with the Sales Manager role to be brought in automatically to important Opportunities

We will create a formula that adds our Sales Manager into the Team for any Opportunity that has an Est Revenue greater than 1 million euro. 

This formula will also remove our Sales Manager from this Team if the Est. Revenue goes below 1 million euro. 

Note 1: For this example you will need to have a team called Sales Manager setup beforehand. It will need to have the role Sales Manager given to it. 

N52 Formula Manager Solution

The Formula Manager solution works like this:

  • A formula of type 'Save - Perform Action' is created on the Opportunity entity
  • This Formula will be triggered whenever an Opportunity is created or the Est. Revenue field is updated
  • The formula will add all Users with the Security Role 'Sales Manager' to the Team Access for the Opportunity record if the Est Revenue is greater than 1 million euros
  • It will also remove these Sales Managers if the Est Revenue goes below 1 million euros

N52 Formula Manager Steps

  • Create a new formula of type 'Save - Perform Action'
  • Set the Mode to 'Server Side'
  • Set Event to 'Create & Update'
  • Set Source Entity as 'Opportunity '
  • Set Source Property to 'Est. Revenue'
  • Click into the Formula Editor canvas
  • Copy and paste the formula below into the Formula Editor
  • Click Save
  • Click on the Fetch-Xml tab
  • Click the "+" symbol. 
  • For Name , enter "Find All users with Sales Manager Role"
  • For Query, please copy and past the Fetch XML below.
  • Click Save and Close.
  • You are now ready to test.


Formula

if(Containsdata([opportunity.owningteam.name.?]), 

  If ([opportunity.estimatedvalue] > 1000000, 

    AddUsersToTeam([opportunity.owningteam.name.?], 
     		    FindListValuesEx(FindRecordsFD('Find All users with Sales Manager Role'),
       		  'systemuserid')), 

    RemoveUsersFromTeam( [opportunity.owningteam.name.?], 
   		        FindListValuesEx(FindRecordsFD('Find All users with Sales Manager Role'),
        	       'systemuserid'))
  ) , 

  'NoOp'
)

FetchXML

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true">
  <entity name="systemuser">
    <attribute name="fullname" />
    <attribute name="businessunitid" />
    <attribute name="title" />
    <attribute name="address1_telephone1" />
    <attribute name="positionid" />
    <attribute name="systemuserid" />
    <order attribute="fullname" descending="false" />
    <link-entity name="systemuserroles" from="systemuserid" to="systemuserid" visible="false" intersect="true">
      <link-entity name="role" from="roleid" to="roleid" alias="ac">
        <filter type="and">
          <condition attribute="roleid" operator="eq" uiname="Sales Manager" uitype="role" value="{8BEDBFB8-0095-44B2-8990-616B86F06921}" />
        </filter>
      </link-entity>
    </link-entity>
  </entity>
</fetch>

Did you know?

North52 Helps with Complex Logic as Part of a Workflow / Power Automate Flow

The North52 Decision Suite provides functionality for you embed complex logic as part of a native Dynamics Process (Workflow/Action) or a Power Automate Flow.  

Imagine if you could do an elibility check with several hundred possible combinations as part of your workflow process? You can do this easily by combining North52's Process Genie functionality with a Decision Table.

Even something as mundane as returning the next working day for your workflow (surprisingly difficult to achieve without code) can be easily done with North52.

Learn more about Process Genie