21 Aug, 2020
Posted on 21 Aug, 2020 by Admin, Posted in Dynamics-365 Sales Dynamics 365 Field Service
In Field Service, you can create work orders automatically by using agreements and the interval in which the work orders are created can be set up by using booking recurrence from the agreement booking setup, but this might be confusing and time consuming for clients/users, so in this blog we will see how you can configure the booking recurrence and keep it at just one click.
To achieve this follow the below steps:
The structure of the XML string for most commonly used Booking Recurrence Pattern is given below:
For Creating Bookings Weekly:
var recurrenceSettingXml = "" weekly 1 AGREEMENTSTARTDATE AGREEMENTENDDATE
For Creating Bookings Monthly:
var recurrenceSettingXml =" monthly 1 7 AGREEMENTSTARTDATE AGREEMENTENDDATE
For Creating Bookings Quarterly:
var recurrenceSettingXml = "" monthly 1 7 AGREEMENTSTARTDATE AGREEMENTENDDATE
For Creating Bookings Bi-Annually:
var recurrenceSettingXml = "" monthly 1 7 AGREEMENTSTARTDATE AGREEMENTENDDATE
For Creating Bookings Annually:
var recurrenceSettingXml = "" yearly 1 AGREEMENTSTARTDATE AGREEMENTENDDATE
Where,
So, to finally use this functionality and generate the XML string based on the selected option set value and set it to the Recurrence settings field. You can simply write a JavaScript code for generating the XML string
Use the following code snippet to assign the selected option set’s value to Recurrence settings field:
formContext.getAttribute(“msdyn_recurrencesettings”).setValue(recurrenceSettingXml);
Comment