Views:

Scenario Overview

In this scenario you need to implement a business rule that will change the business process flow &  stage on the opportunity entity when the estimated revenue of the Opportunity is set to less than $1,000. 

You can use this example to perform either of the two actions,

  • Change the Business Process Flow & the Stage
  • Just change the Stage of the current Business Process Flow

 

Note1 : If you are using CRM 2015 Update 1 or higher you will need to also set the field named traversdpath in order to get this to work correctly
Note2 : If you are using CRM 8.0+ or above do not use this KB article as it no longer applied. Instead look at these  KB articles ,

https://support.north52.com/knowledgebase/article/KA-01127-dynamics-crm-365-xRM-Formula-122-Automatically-Change-Business-Process-Flow-Stage-based-on-User-Input/en-us

https://support.north52.com/knowledgebase/article/KA-01938-dynamics-crm-365-xRM-Formula-171-Sample-Automatically-change-Business-Process-Flow-stage-based-on-field-value/en-us


North52 Decision Suite Solution

The North52 Decision Suite solution works like this,

  • Use the FindValue() function to lookup the guid of the required business process flow
  • Use the FindValue() function to lookup the guid of the stage 
  • Use the UpdateRecord() function to update the opportunity record with the 2 guids from above
  • The formula type is set to Process Genie so we can call the formula from a wortkflow 

North52 Decision Suite Steps

The following set of steps outline how to create this Formula

  • Create a new formula of type 'Process Genie'
  • Set the Source Entity to 'Opportunity'
  • Copy & paste the formula below into the formula description field & click save
  • Create a new workflow within CRM where you add a condition to check that the estimated revenue is less that $1,000.
  • If it is less than $1,000 then use the custom workflow activity 'N52 Process Genie' to call the formula by passing in the short code from the formula. See the screenshot below for how this is setup.
  • You can now test this on the Opportunity entity.

Formula

UpdateRecord( 'opportunity',                    
                         [opportunity.opportunityid],
                         SetAttribute('processid',     
                                               FindValue('workflow',                      
                                               SetFindAnd('name', 'statecode'),           
                                                SetFindAnd('QuickOpportunityProcess', '1'), 
                                                'workflowid' ) ),              
            
                         SetAttribute('stageid',                                           
                                      FindValue('processstage',                            
                                      SetFindAnd('processid', 'stagename'),                                           
                                      SetFindAnd(FindValue('workflow', SetFindAnd('name', 'statecode'),
                                      SetFindAnd('QuickOpportunityProcess', '1'), 
                                                 'workflowid' ), 'Qualify'), 'processstageid' ) )                  
                         )

Did you know?

You can easily schedule recurring processes or CRM record updates

Every business has recurring processes and tasks that need to be done on repeatable and scheduled basis. Microsoft Dynamics 365 users are often surprised to learn that it is difficult to achieve using standard functionality. The North52 Scheduler makes it easy to trigger workflows and/or advanced business logic for specific entity records on a scheduled basis. 

Key features include:    

  • Create Recurring Schedules within Dynamics CRM
  • Powerful Record Targeting - easily create queries to target a specific set of records
  • High Performance - can process 100,000+ records on a scheduled basis
  • Execute Workflow/Action or Update Entities
  • Native to Dynamics 365

Learn more about the Scheduler