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.

N52 Formula Manager Solution

The Formula Manager 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

N52 Formula Manager 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)
  • Publish the workflow
  • You are now ready to test

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?

You can create customized buttons to trigger complex business rules

North52's Decision Suite has functionality that we call Quick Buttons that allows you to place buttons on a form which when clicked will trigger a North52 Formula.  The business rule logic could be as simple as triggering a workflow or a much more complex process which involves many actions - the full power of the North52 business rules engine for Dynamics 365 can be used. 

The button's themselves can be subject to business rules, that show/hide, activate/deactivate or and/or change labels. This is configured using Decision Tables allowing complex decision logic to drive the button options that are presented to users.

Learn more about Quick Buttons