knowledgecenter-breadcrum

Knowledge Center

21 Aug, 2020

Simplify Agreement Booking Recurrence With One Click

Posted on 21 Aug, 2020 by Admin, Posted in Dynamics-365 Sales Dynamics 365 Field Service

Simplify Agreement Booking Recurrence With One Click Blogs

Simplify Agreement Booking Recurrence With One Click

Introduction

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.

Dynamics 365 Field Service OOB functionality to setup Booking Recurrence

 

  • Go to Agreements > Agreement Booking Setup –> Booking Recurrence.
  • Once user clicks on the “BOOKING RECURRENCE” button, the following window is opened, where the user provides the required information.

  • The above Booking recurrence pattern is an example of Monthly recurrence which will create a Work Order on 1st weekday of every month from the Start Date to End Date.
  • A user will require too many clicks and need to set the proper patterns to achieve requirements, and this can be tedious for some users.

Simplified one click solution for Booking Recurrence

  • To make the above process simple for Users, you can make a custom Option Set field “Booking Recurrence” on the Booking Setup form with the most commonly used option values like: “Weekly”, “Monthly”, “Quarterly”, “Bi-annually” and “Annually” as indicated in the below picture.
  • You can also add this field on some other entity if you are using the other entity to create the Agreement.

  • And by selecting any one option from the above option set, the Booking Recurrence pattern is automatically generated. Based on the Booking Recurrence pattern, the Booking Date record gets created.

To achieve this follow the below steps:

  1. There is a “Recurrence settings” field on the Agreement Booking Setup form, but it is hidden. This field takes an xml string.
  2. You will need to set the XML string in the field to achieve the above functionality.
  3. Once the XML string is set the OOB Field service workflow is triggered and the booking recurrence is set

The structure of the XML string for most commonly used Booking Recurrence Pattern is given below:

For Creating Bookings Weekly:

var recurrenceSettingXml =
"weekly1 AGREEMENTSTARTDATE  AGREEMENTENDDATE "

For Creating Bookings Monthly:

var recurrenceSettingXml =
monthly17AGREEMENTSTARTDATE  AGREEMENTENDDATE "

For Creating Bookings Quarterly:

var recurrenceSettingXml =
"monthly17AGREEMENTSTARTDATE  AGREEMENTENDDATE "

For Creating Bookings Bi-Annually:

var recurrenceSettingXml =
"monthly17AGREEMENTSTARTDATE  AGREEMENTENDDATE "

For Creating Bookings Annually:

var recurrenceSettingXml =
"yearly1AGREEMENTSTARTDATE  AGREEMENTENDDATE "

Where,

  • AGREEMENTSTARTDATE– “Agreement start date” of Agreement record.
  • AGREEMENTENDDATE– “Agreement end date” of Agreement record.

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

This is a Required Field

Loading

Recent Updates

Business Central thumbnail image
Blogs
06 Jan, 2025

What is Dynamics 365 Business Central? A Comprehensive Beginner's Guide

Dynamics 365 Business Central is a unified business management system offered by Microsoft. It helps businesses automate and manage various…

READ MORE
Thumbnail D365 for Marketing
Blogs
16 Dec, 2024

10 Reasons Why You Need Dynamics 365 for Marketing

This blog discusses the top 10 reasons to choose Dynamics 365 for Marketing to improve your business's marketing efforts.  …

READ MORE
Thumbnail_top 10 benefits of
Blogs
02 Dec, 2024

Top 10 Benefits of Microsoft Dynamics 365

This blog lists the advantages of Microsoft Dynamics 365, focusing on how it can improve your business operations.    …

READ MORE