- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2023 03:55 AM
We are trying to customize the script include "AppointmentBookingImpl" by amending one word that appears in the work notes when an appointment booking request is submitted on the portal.
In this script include, right at the bottom is the following code
generateScheduleWorknotes:function(taskGR, start, end, timezone, reschedule){
var actual_start = new GlideDateTime();
var actual_end = new GlideDateTime();
actual_start.setDisplayValueInternal(start);
actual_end.setDisplayValueInternal(end);
if (reschedule){
taskGR.comments = gs.getMessage("Appointment is rescheduled to {0} - {1} ({2})",[actual_start.getDisplayValue(),actual_end.getDisplayValue(), timezone]);
} else {
taskGR.comments = gs.getMessage("Appointment is scheduled for {0} - {1} ({2})",[actual_start.getDisplayValue(),actual_end.getDisplayValue(), timezone]);
}
},
type: 'AppointmentBookingImpl'
};
Where it says "Appointment is scheduled for" , we are trying to make this "Appointment is requested for" as we have built a custom appointment approval process in place.
For guidance, I have used How to extend an existing Class in a new script include - Support and Troubleshooting - Now Support ...
I've come up with the following script include which is not working.
var AppointmentBookingImpl2 = Class.create();
AppointmentBookingImpl2.prototype = Object.extendsObject(AppointmentBookingImpl,
{
generateScheduleWorknotes: function (taskGR, start, end, timezone, reschedule) {
var actual_start = new GlideDateTime();
var actual_end = new GlideDateTime();
actual_start.setDisplayValueInternal(start);
actual_end.setDisplayValueInternal(end);
if (reschedule) {
taskGR.comments = gs.getMessage("Appointment is rescheduled to {0} - {1} ({2})", [actual_start.getDisplayValue(), actual_end.getDisplayValue(), timezone]);
} else {
taskGR.comments = gs.getMessage("Appointment is requested for {0} - {1} ({2})", [actual_start.getDisplayValue(), actual_end.getDisplayValue(), timezone]);
}
},
type: "AppointmentBookingImpl",
});
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2023 07:46 AM
You don't have to extend the script include for this. All you need to do is update the record in the Messages [sys_ui_message] table where Key = Appointment is scheduled for {0} - {1} ({2})
If there is no record with this Key, simply create one.
Blog: https://sys.properties | Telegram: https://t.me/sys_properties | LinkedIn: https://www.linkedin.com/in/slava-savitsky/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2023 04:52 AM
Hi @Ahmet1 ,
Hope you are doing well.
Where this script include is called did you replace there with the custom script include that you have created.
Please mark this response as correct or helpful if it assisted you with your question.
Regards,
Harshal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2023 05:29 AM
Hi Harshal,
I'm not sure where it's called, I contacted support to amend the wording that appears in the comments when a user submits an appointment booking request using the Walk-Up Appointment booking module. They directed me to the "AppointmentBookingImpl" script include and mentioned that this wording which appears in comments "Appointment is scheduled for" is in this script include. This original script include is read only however they mentioned that I am able to make changesr by using extend script include function.
At that point I created the above modified version to change the wording from "Appointment is scheduled for" to "Appointment is requested for" using the guidance in the knowledge article but this hasn't worked for me. I tried to lookup where the script include is mentioned in any Business Rules or Client Scripts but cannot find it being called anywhere there.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2023 05:40 AM
@Ahmet1 type in your extended script include should be as follows.
type: "AppointmentBookingImpl2",
In the script
taskGR.comments = gs.getMessage("Appointment is scheduled for {0} - {1} ({2})",[actual_start.getDisplayValue(),actual_end.getDisplayValue(), timezone]);
Since the text Appointment is scheduled for is coming from sys_ui_message table, why don't you change the message within the sys_ui_message table instead of extending the script include.
You can find the message entry in sys_message table as follows
Navigate to
Hope this helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2023 07:59 AM
@Ahmet1 I already provided the solution two hours back but mine was not select as solution 😞