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

                      • Risk Matrix for Change using Custom Module

                        PURPOSE: Creating Risk matrix for changes that automatically calculates the risk of a change based on its priority and impact. Similar to the Priority matrix in the request module. TESTED IN BUILDS: 14504 STEPS: Step 1: Configure the Custom Module: ...
                      • 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 ...
                      • Restrict Dashboard Customization using page scripts

                        Use case In scenarios where administrator would like to have a fixed dashboard, then they can remove the Dashboard settings button using the below steps 1. Go to Admin >> Page Script >> Apply the below script based on a condition ...
                      • How to restrict automatic association of technicians to an account / sites ?

                        This article is applicable from 10600 builds. Scenario - At times the technicians will see extra Accounts / Sites in their login. Below is the reason and its solution : -> While creating an account, a common site will be automatically created by ...