Views:

Scenario Overview

This simple scenario is an example of how to make a change a score from a Survey response based on how many other open cases the customer has in CRM currently.

The reason for this would be that if a customer has multiple open cases then we might lower the survey response score to highlight the fact that this customer may need some additional care or support.

Survey Response

North52 Decision Suite Solution

The North52 Decision Suite solution works like this:

  • Formula of type 'Save - To Current Record' is set up on the Survey Response entity  
  • The formula is configured to the Pre-Operation stage.
  • The formula is triggered on Create of the Survey Response.

N52 Formula

                      

North52 Decision Suite Steps

The following set of steps outline how to create this Formula:

  • Create the formula of type Save - To Current Record on the Survey Response entity 
  • Copy in the formula code below
  • Use N52 Commands button to Toggle Advanced View and set the Stage to Pre-Operation
  • Create the FetchXML CountOpenCases and copy in the code below.
  • Click save and test

Formula

SmartFlow(
  
    SetVar('OpenCases', FindCountFD('CountOpenCases', 
                      'incidentid', 
                      '0', true,
                      SetParams([msdyn_surveyresponse.msdyn_contact.contactid.?]),
                      true)),
  
    Setvar('Score', [msdyn_surveyresponse.msdyn_score]),
 
    Iftrue(GetVar('OpenCases') > 0,  GetVar('Score')-20)

)

FetchXML CountOpenCases

<fetch version="1.0" >
  <entity name="incident" >
    <attribute name="incidentid" />
    <filter>
      <condition attribute="contactid" operator="eq" value="{0}" />                              
      <condition attribute="statecode" operator="eq" value="0" />
      <condition attribute="prioritycode" operator="eq" value="2" />
    </filter>
  </entity>
</fetch> 

Did you know?

North52 has over 500 functions to help you implement advanced business rules and complex decision logic

One of the biggest costs on most Microsoft Dynamics 365/CRM project is custom coding. This is where consultants or developers are invloved in writing 100’s if not thousand’s of lines of code in Javascript and/or C#.

The Formula Manager, part of the North52 Decision Suite is a business rules engine that aims to eliminate this custom coding by using simple formulas instead. It is significantly faster (up to 10 times) than writing custom code and you get the added bonus of lower cost updates if a business rule changes in the future (it is much faster and thus cheaper to change it using a Formula rather than custom code).

There are over 500 functions available in the North52 Decision Suite business rules engine!

Learn more about North52 Business Process Activities