So, there are three parts of the script. In the first part we have a function name ShowConfirmationPopup. 

find_real_file.png

This function is running on client side and generating a nice Send Meeting Notification popup with two buttons Send to all and Send to New. When you click on Send to new below function called and executes.

find_real_file.png

Above function is running on server side and it first remove the popup from the screen and trigger event which in response send notification to all the new attendees. 

If user clicks on Send to All then third function called and executes.

find_real_file.png

This function is also running on server side and it triggers event that send notification to all the attendees. 

In your case if you write a scheduled job that runs on server so you cannot leverage client side code (first function) rather you can only use next two functions that is running on server side and supported by Scheduled job. 

I hope this will help you get an idea of how UI action is working and how you can leverage the script in job. 

Please mark this accepted & helpful, if you applicable.

 

Thanks & Regards,

Sharjeel

 

Hi Sharjeel,

I cant see event -sn_change_cab_notify_all_attendeesfind_real_file.png

sn_change_cab_notify_all_attendees is action name being used in Notify All Attendees Ui action and which is getting called from Send meeting request to attendees via that action name. Events are getting triggered by Notify All Attendees UI action. See screenshot below.

find_real_file.png

find_real_file.png 

Above Ui action is calling CABMeeting() script include and that script include calling another script include. 

I would recommend not to go that deep into the script as you are not very into scripting so will be lost. 

If you know how to script a scheduled job, just wrap two server side functions I explained in the first UI action into the Script include and call from the job with minor tweaks. It will do the job. 

Please mark this accepted & helpful, if it helps.

 

Thanks & Regards,

Sharjeel

 

Actually Job I was trying since your first reply

See- after if  section- not able to understand what is happening

find_real_file.png

CABMeeting script include is in scoped app so you have to give fully qualified name domain + script include name.

sn_change_cab.CABMeeting(gr)

 

Also, here is the sample code I just ran for quick testing in the background script and its working fine. 

var gr = new GlideRecord('cab_meeting');
gr.addQuery('sys_id', <sys_id>); // replace sys_id with any Cab meeting sys id.
gr.query();
gr.next();
gs.print(gr.getRowCount());

var notifiedAttendeesCount = new sn_change_cab.CABMeeting(gr).createCABAttendeeNotifyEvents();
var infoMessage = notifiedAttendeesCount > 0 ? gs.getMessage("Notifications sent to all attendees") : gs.getMessage("No notifications sent as there are no attendees");
gs.print(infoMessage);

 

Replace <sys_id> with one of your Cab meeting sys ID in the above code and test in background script and see the output for reference. after that you can modify this as per your need

Let me know if you face any issues.

 

Please mark this accepted & helpful, if it helps.

 

Thanks & Regards,

Sharjeel