Overview
In this scenario, while waiting for a response to an original query regarding their new telephone connection, a customer has opened up a new case asking for an update.
To make better use of the support User's time, we want to automatically merge any open Case with the same Contact and same Subject using North52's advanced business rules engine for Microsoft Dynamics 365.
To keep it consistent and easy to manage, we want to merge the new Case into the oldest Case.
Rules for Case Merging
Rule # | Description |
---|---|
1 |
Upon Case creation, find any preexisting active Case with the same Contact and Subject and merge the new Case into this preexsiting one. |
North52 Decision Suite Solution
The North52 Decision Suite solution works like this:
- A Formula is set up on the Create even of a Case which:
- Checks to see if there are any Cases with matching Subjects and Contacts
- If there are, the Formula will
- Collect all Cases and order them by the Oldest
- Create a Note on the current Case to say that the Case has been merged to the oldest Case
- Merge the new Case into the Oldest Case
- If there are, the Formula will
- Checks to see if there are any Cases with matching Subjects and Contacts
Set up Formula
- Open the North52 App
- Navigate to Business Process Activities > Formulas
- Create a new Formula, setting the following values in the Formula Guide:
- Source Entity set to Case
- Set Formula Type to Save - Perform Action
- Select the Decision Table editor
- Change the Name of the Formula to Merge cases with same subject matter
- Click Save
Set up Dynamic FetchXML Query
- Select the Fetch-Xml tab, then click the plus (+) button
- For Name, enter Related Cases
- For Fetch Xml Query, copy and paste the following:
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false"> <entity name="incident"> <attribute name="title" /> <attribute name="createdon" /> <attribute name="incidentid" /> <attribute name="title" /> <order attribute="createdon" descending="false" /> <filter type="and"> <condition attribute="statecode" operator="eq" value="0" /> <condition attribute="primarycontactid" operator="eq" value="{0}" /> <condition attribute="subjectid" operator="eq" value="{1}" /> <condition attribute="incidentid" operator="ne" value="{2}" /> </filter> </entity> </fetch>
- For Parameter {0} enter [incident.primarycontactid] (or select from the Source tab)
- For Parameter {1} enter [incident.subjectid] (or select from the Source tab)
- For Parameter {2} enter [incident.incidentid] (or select from the Source tab)
- The completed wizard will look like this:
- Click Generate
Find Oldest Matching Case Title (create Global Calculation)
- On the Function tab, search and find the function FindRecordsValue
- Shift-click the Function to open its wizard
Find Oldest Matching Case ID (create Global Calculation)
- On the Function tab, search and find the function FindRecordsValue
- Shift-click the Function to open its wizard
Set up Decision Table
- On the Decision Table Editor
- Select column B and right-click Insert > Insert Action
- Select cell A2
- Go to Source and select Global Calculations > Oldest Matching Case ID
- Select cell A4
- Find and shift-click the function ContainsData
- Select cell B4
- Copy and paste in the following:
CreateNote('Case merged with old case '+ GetVar('Oldest matching Case'), 'incident', [incident.incidentid], 'Please see the following case for updates: '+ GetVar('Oldest matching Case'))
- Copy and paste in the following:
- Select cell C4
- Copy and paste in the following:
Merge('incident', GetVar('Oldest matching Case ID'),[incident.incidentid])
- Copy and paste in the following:
- Click Save
Testing
To test this scenario, create two cases with the same Subject and same primary Contact. The second one that is created should be merged into the oldest one.