Below is another example of a Booking Rule as well as an interesting find.

This new Booking rule fetches the Characteristics from both the Resource and the Work Order and compares them to see if the Resource is valid to do the job.

First of all it will check if the Resource matches the Characteristics needed for the job and then will it check if their proficiency rating is equal or higher to the Work Order Requirement.

Full Code below:

 

An interesting thing that I found out is that you can also trigger the booking alert from the Schedule Assistant. Nothing that Interesting I know! But I found an interesting difference between how the sbContext.newValues.ResourceRequirementId brings back its Id.

When you drag and drop a Work Order on to the Schedule Board it brings back the ResourceRequirementId without curly braces. But if you use the Schedule Assistant it will bring it back with curly braces! Its important to know that this happens as if its not handled appropriately within the JavaScript it will cause an error when trying to Schedule a Work Order.

 

Schedule Board – (No Curly Braces)

 

Schedule Assistant – (Curly Braces)

So please make sure that you handle this by removing the braces by using this:

My previous blog on Booking Rules for reference – http://www.kentom.co.uk/?p=455

Hopefully this has been helpful!

Leave a Reply

Your email address will not be published. Required fields are marked *