Restrict double booking of rooms and provide feedback using custom module

Restrict double booking of rooms and provide feedback using custom module

Usecase:

This article outlines the steps for implementing a room booking feature using a custom module, Which blocks the dates if a room is already booked.  The objective is to prevent double booking of rooms and provide feedback when attempting to book an already reserved room within the selected time range.

Requirement:
The application will display a message when attempting to book a room that is already reserved during the chosen time frame.

Steps to follow:

Step1:Navigate to Admin>>custom module>>Create new custom module>>Enter the details as in the below snapshot.



Step2:Under Form customizer>>Create four custom additional fields as in the below snapshot,namely:
  1. Date Fields: From , To 
  2. Picklist Field: Room Name
  3. Single Line Field: Booked By
Step3:Under configurations>>Permissions can be modified as per requirement, sample attached below:


Step4:  Goto Admin > Developer Space > Custom Module > Copy & Paste the content of attached roomBooking_CM.txt and save it with a name.
  1. Update the URL and technician key as per your instance.
  2. For the Integration key/Technician key 
Step5: Goto Admin>>Global function>>copy paste the globalfunction content.txt and save it with a name.(Update the URL and technician key as per your instance).


Step6: Navigate to Admin>>Custom module business rule>>Configure the created custom function in a business rule to get executed for every new record being created for the custom module.


Now when attempting to book a room that is already reserved during the chosen time frame the application displays the below message.



Note:The field values should be same as in the screenshot for the script to work,If you change the value names then the same should be modified and updated in the script to work.

                  New to ADSelfService Plus?

                    • Related Articles

                    • Implementing Room Booking feature using custom module

                      Usecase: This article outlines the steps for implementing a room booking feature using a custom module, and requires a feature that blocks the dates if a room is already booked. The objective is to prevent double booking of rooms and provide feedback ...
                    • Script to add worklog using custom schedule

                      What is a Custom Schedule? Custom Schedules are actions scheduled on a specific date and time with or without repeat frequency. The actions are specified in a customized script file. Any data from ServiceDesk Plus can be sent to the script through ...
                    • Notification script using Custom function in custom trigger

                      This is applicable from 10600 builds. From 10600 , Business rules dont have Email notification feature. The same use case be achieved through Custom triggers feature as mentioned below. Script to enable notification of request creation using custom ...
                    • Risk Matrix for Change using Custom Module

                      Overview: A risk matrix helps in identifying risks based on how likely they are to happen and how serious their impact could be. This makes it easier to decide which risks need urgent attention and which ones can be watched over time. It helps manage ...
                    • Change Risk Assessment Questionnaire using Custom module - Implementation steps

                      We’re excited to share a step-by-step guide( Attached) on implementing a Change Risk Assessment Questionnaire in ServiceDesk Plus using the Custom Module feature. This solution leverages Custom Modules, Change Additional Fields, and Field & Form ...