Skip to main content

Notifications

Announcements

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
pastedimage1668636863907v1.png
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.
pastedimage1668637013644v2.png
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.
Thanks.
  • 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

    pastedimage1669295748077v1.png

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

    pastedimage1669295856741v2.png

  • 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 - www.daymandynamics.com/.../

    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) {

       debugger;

       alert("Hello");

       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 . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 225,490 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans