Skip to main content



No record found.

Dynamics 365 Community / Forums / Field Service forum / Booking rule - Not wor...
Field Service forum
Suggested answer

Booking rule - Not working - Help me

Posted on by 25

Hello guys

I have a problem with a booking rule. When a execute the booking rule in a scheduler assistan turn back an error.

 The message:

Invalid data in Booking Rule 'New Bookin rull', method 'BookingInWorkHours'. Rule was skipped
When the same booking rule is executed in schedule board everynthins its ok.
I was program an alert in the fuction, but when the asistan execute the booking rule doesn´t show the hello.
May i Have to do something to run the same function  in the assistand scheduler? 
In the documentatation of microsoft dont say something like that.
  • Las Catalinas Profile Picture
    Las Catalinas 25 on at
    RE: Booking rule - Not working - Help me

    I appreciate your example. But my problems its when I used de scheduler assistant.

    Booking rule works in schedule board but if a press this button


    and select a resource and press the button booking  this error is triggered 


  • Suggested answer
    Thomas David Dayman Profile Picture
    Thomas David Dayman 11,319 on at
    RE: Booking rule - Not working - Help me

    I have an example here -

    But its quite dated now, but it should help you.

  • Las Catalinas Profile Picture
    Las Catalinas 25 on at
    RE: Booking rule - Not working - Help me

    I write a second function because I think that in schedule assistant need more params but I just use one.

    function BookingInWorkHours(sbContext) {



       var start = sbContext.newValues.StartTime.toISOString();

       var end = sbContext.newValues.EndTime.toISOString();

       return IsAvailable(sbContext.newValues.ResourceId, start, end);


Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .


André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,696 Super User

Martin Dráb Profile Picture

Martin Dráb 225,490 Super User

nmaenpaa Profile Picture

nmaenpaa 101,148


Featured topics

Product updates

Dynamics 365 release plans