Views:

Scenario Overview

In this business scenario the end user wants to create a Task record in CRM and set the end date for that task as the end of the calendar month. We created this using a workflow called Generate FollowUp Task that would:

  • Create the Task record
  • Use the Process Genie to set the end date on the task

Note : This is an example of how to "context switch" in a Process Genie by using the Primary Entity ID parameter of the Process Genie workflow step.

North52 Decision Suite Solution

The North52 Decision Suite solution works like this:

  • A formula of type Process Genie is created so it can execute as a step within a workflow
  • When it reaches the Process Genie step in the workflow it will execute the formula, switching the context from the Account entity to the Task entity
  • The Formula first retrieves today's date and then gets the last day of the month
  • Next the Formula updates the Scheduled End date for the Task that was created as part of the workflow

North52 Decision Suite Steps

The following set of steps outline how to create this Formula

  • Create a new formula, setting the following values in the Formula Guide
    • Source Entity set to Task
    • Set Formula Type to Process Genie
    • Select the Decision Table editor
  • Change the Name of the formula to Task - Process Genie - Set Due Date to End of Month
  • Right-click on column A and select Delete > Delete Column (there are no Conditions for this Decision Table so we remove this column)
  • Click in cell A2, select the Source tab, type Due in the search field and press enter
  • Expand the Source node, and click Due Date to add the field to cell A2
  • Click in cell A4, select the Functions tab, type Getlast in the search field and press enter
    • Shift-click the GetLastDayOfMonth function to open the function wizard
      • Leave the Friendly Name field blank as we are going to insert the function directly into the cell for this example.
        • Note : If we wanted to show a more friendly name and move the function logic to the Global Actions sheet we would enter a name here and select Action from the Type drop down
      • Click inside the Input Date field. We are going to add a function to return Today's date rather than use a date field from the Task entity.
        • On the Function tab, type utcdate into the search field and press enter. Click on UtcDate to add this function to the Input Date field of the wizard
      • Leave the Offset field blank
      • Click Generate
  • Click Save
  • Take a note of the Formula Short Code from the Formula form header

Workflow Steps

Follow these steps to create the workflow that will trigger the formula above:

  • Create a new Workflow named Generate FollowUp Task on the Account entity
  • Set it to run only On Demand
  • Add a new step to create your Task, type Generate Task for the step description
  • Add a new step - North52 > N52 Process Genie - to the workflow to call the Process Genie, click the Set Properties button:
    • Set the Formula ShortCode to be the one on the formula you just created, in this case ac1
    • Set the Primary Entity ID to Generate Task(Task) -> Record URL(Dynamic) (this provides the formula the ID of the Task record)
  • Activate the workflow
  • You are now ready to test (simply run the workflow from an Account record)


Workflow Configuration




Process Genie Configuration

Wizard - GetLastDayOfMonth

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

Note: For Input Date , you will need to type UtcDate() or use the Function tab to select the UtcDate function.
 

 

 

Did you know?

North52 provides Automated Testing for Dynamics 365

TestShield® is a unique solution that helps you automatically test your End to End Dynamics 365/CRM and Power Automate processes.  It is built on the proven and robust North52 Business Process Activities rules engine and offers the ability to repetitively test and report on your key business processes.

TestShield's key features:

  • Fully integrated with Dynamics 365
  • Easy to use by BA's, Testers, and Developers
  • Advanced test data generation and management
  • Codeless advanced testing reduces test creation time
  • Test and validate across all layers with a single test

Learn more about TestShield