Views:

Overview

When scheduling resources with Dynamics for Field or Project Service often you need to validate business rules before allowing the booking to be created. The out of the box Booking Rules functionality enables you to do this by writing custom JavaScript, however, this requires a developer and only works on the client side. With North52 it is easy to create Booking Rules using a Decision Table and show messages to the end user, preventing bookings according to your rules. 

Booking Rules

Rule # Description
1

Booking cannot be made for an Account when the Billing Account is on credit hold.

2

Booking cannot made for an Account if the parent Work Order has not been Scheduled.

North52 Decision Suite

The North52 Decision Suite solution works like this:

  • A Formula of type Validation is set up on the Resource Requirement entity which:
    • Looks up the Billing Account of the associated Work Order and check if it is on Credit Hold
      • If it is then a message is added to the Validation Message variable
    • Looks up the parent Work Order checking for the System Status of Open - Unscheduled
      • If it is then a message is added to the Validation Message variable
    • If there any of the above rules have been met, then the Validation Message is shown to the end user and the booking is prevented

Set up Formula

  • Create a new formula, setting the following values in the Formula Guide:
    • Source Entity set to Resource Requirement
    • Set Formula Type to Validation
    • Select the Decision Table editor
  • Change the Name of the formula to Resource Requirement - Validation - Credit Hold and Parent Work Order Status
  • Click Save

Add the Conditions

  • Select cell A2
    • Select the Source tab and expand the Related (N:1) node
    • Expand the msdyn_workorder (msdyn_workorder) node
    • Expand the account (msdyn_billingaccount) node
    • Expand (Attributes)
    • Select Credit Hold (Value) to add it to cell A2
  • Select cell A4
    • Expand the Credit Hold (Value) node from the previous step
    • Select Yes to add TRUE to cell A4
  • Select anywhere in column B
    • Right-click and select Insert > Insert Condition
  • Select cell B2
    • Select the Source tab and expand the Related (N:1) node
    • Expand the msdyn_workorder (msdyn_parentworkorder) node
    • Expand (Attributes)
    • Select System Status {Value} to add it to cell B2
  • Select cell B5
    • Expand the System Status {Value}  node from the previous step
    • Select Open - Unscheduled to add {Open - Unscheduled} to cell B5
  • Select anywhere in column C
    • Right-click and select Insert > Insert SetVarConcat Calculation (*-)
    • Replace Set Name with Validation Message
  • Select anywhere in column D
    • Right-click and select Delete > Delete Column*

* Note if there was only one rule/validation message to be shown we could simply put the message in the Action column cell without inserting the SetVarConcat Calculation (*-) column.

Add the Validation Messages

  • Select cell C4 and type '* The Account is currently on credit hold so no new Work Orders can be booked at present.<br>'
    • The <br> text is a HTML line break that will ensure the next message is on a new line when displayed to the user
  • Select cell C5 and type '* The Parent Work Order has not been scheduled, so this child Work Order cannot be scheduled.'
    • The <br> text is not required for the last message

Set the Decision Table to execute all rows, regardless of match

  • Right-click anywhere on the sheet and select Hit Policy, then uncheck the Exit this Decision Table on First Match option
  • Click Save
  • Your Decision Table should look like this:

Testing

Ensure you have Resource Requirement record where the Work Order Billing Account is on Credit Hold and the Work Order has a Parent Work Order with a  System Status of Open - Unscheduled, this will then trigger both rules.

Did you know?

It is Faster, Easier and Smarter using North52

We help you deliver Dynamics 365 projects with complex decision logic/business rules:

FASTER.

Our no code business rules engine helps deliver CRM/CDS projects up to 10 times faster than using custom code.

EASIER.

Simple to use point-and-click interface to build simple or complex business rules.

SMARTER.

Lower your project risk and slash ongoing maintenance costs.

Learn more about the North52 Decision Suite