Tuesday, August 24, 2021

D365 ClientExtensions Sample - Custom Booking Button

The ClientExtensions feature in the D365 Schedule Board is still a kind of a hidden feature and not really advertised by Microsoft. Maybe because the integration points are not perfectly documented yet and there are still changes ongoing.



In some Insider Program communities, you can find some hints for this feature also from MS colleagues but those are not working perfectly. We discussed our issue with a MS Support Engineer and could solve it. So I just want to share the findings.

The initial approach can be found here (Insider Program access required). This one was not working directly for us since we needed the button to work directly after the Booking item was created (e.g. via Drag&Drop from 'Unscheduled Work Orders' area). In the MS sample, a page reload was required.

To get this fixed, override of Board.RenderHourlyBooking must be used. You can find the full Code Sample on Github.

var sbclientExtension = {

    /** Overrides the required click events in the Booking element */
    override: {
        "Board.RenderHourlyBooking": function (requestContextparentHandler) {
            setTimeout(function () {
                //...                
            }, 5000);
            return parentHandler.execute();
        }
    }
}




Cheers!