Search code examples
dynamics-crmdynamics-365

Dynamics CRM Field Service: Unable to approve time off requests


I'm looking at the Field Service module of Dynamics 365. I'm trying to block out an employee's time on the schedule board by creating a time off request.

I can create the time off request, but as soon as the object is saved, the system automatically deactivates it.

The system will reported success when Approving a time off request but I can't see any changes in the data nor any records created in the audit summary. If I try to Active a time off request, the process fails due to a Business Process Error:

Microsoft.Xrm.Sdk.InvalidPluginExecutionException: Time off request records can't be reactivated.

To the best of my knowledge, there aren't any process changes to time off requests (but I'm unsure how to confirm this). From everything that I've read, this should be a fairly straight forward process so I'm not sure where to look next.

This page from the documentation is a good example of what I'm trying to do. It's failing on step 3 of "Approve a time-off request".

I've tried creating time off requests:

  • in the past
  • for tomorrow and more than 2 weeks future
  • of duration lengths from 2 hours through 2 weeks
  • for various user accounts

The time off requests are not conflicting with booked resources.

Any advice on what I could look into to determine if someone modified any processes / workflows associated with time off requests? Or is there something that I'm not doing that I should be?


Solution

  • I've learned that Microsoft's documentation is not complete and there was a bug.

    Additional info on how Time Off Requests are used

    There are two views of Time Off Requests (TOR) available to managers: Active and Inactive.

    • Active TORs: Lists TORs that a manager needs to approve
    • Inactive TORs: Lists TORs that have already been approved (i.e., the request itself has been dealt with)

    Bookable Resources have a Time Off Approval Required property. When true, TORs created for the user are Active; when false, TORs created for the users are automatically moved to Inactive.

    All Inactive TORs should appear as grayed-out boxes on the Schedule Board. If you attempt to Activate an Inactive TOR, the following error will correctly be reported:

    Microsoft.Xrm.Sdk.InvalidPluginExecutionException: Time off request records can't be reactivated.

    Field Service Bug

    Additionally, we experienced a bug that prevented Inactive TORs from being grayed out on the Schedule Board. I'm not sure if this was a process error or a client-side style issue.

    We observed the bug in Field Service 6.1.0.1462. Upgrading to 6.2.1.38 resolved the issue and allowed Inactive TORs to show up on the Schedule Board.