Multiple Schedules on One Calendar Using "show_schedule.do"

StephenHey
Mega Guru

I am currently building maintenance schedules for each of our business services. Each schedule might have multiple time slots for maintenance.

I noticed that if I go into the schedule, I can use the UI action to call "show_schedule.do" and it appends one sys_id to the end and displays all times for that ONE schedule.

My question is: Is it possible to build a url that would allow me to see multiple SCHEDULES on one calendar with multiple time slots in each schedule? And if so, how would I go about that?

1 ACCEPTED SOLUTION

Not applicable

The change collision plugin has a nice simple example of how to add multiple schedules into a Schedule Page [cmn_schedule_page], for display on the same calendar - look at "Maintenance Windows and Changes", which builds up the schedulePage object with multiple schedules in varying colours.

Documentation here: http://wiki.service-now.com/index.php?title=Schedule_Pages


View solution in original post

9 REPLIES 9

Not applicable

The change collision plugin has a nice simple example of how to add multiple schedules into a Schedule Page [cmn_schedule_page], for display on the same calendar - look at "Maintenance Windows and Changes", which builds up the schedulePage object with multiple schedules in varying colours.

Documentation here: http://wiki.service-now.com/index.php?title=Schedule_Pages


I was able to use a combination of the Schedule Page "Audit History" and "Change" to figure out how to add various schedules onto one calendar.

From the CI screen, I created a UI Action (link) that called my new Schedule Page and appended the sys_id of the CI I was coming from to the URL. The Schedule Page parsed the URL and stored it in the HTML section as a hidden input. The client script then grabbed that hidden input and stuck it in a variable inside of schedulePage. From that point, I utilized the Ajax section and used CI Utils to find all business services attached to the CI I was jumping off from. With those objects, I then added each schedule for each business service to the calendar I was generating.

Thanks for your help James.


juola
Kilo Contributor

Hi Stephen ,



I'm setting up something very similar to your example and I have just one problem. How did you do this part "The client script then grabbed that hidden input and stuck it in a variable inside of schedulePage."?



I couldn't find any examples on how to set variables on client script part and pass it on to Ajax processor.



This is a bit old conversation, but hopefully someone will catch this question.



Thanks in advance.


--Mikko


The URL of the schedule page should be something like:



show_schedule.do?sysparm_type=maint2&sysparm_include_view=monthly,weekly,daily,oldtimeline&sysparm_parm1=foo&sysparm_parm2=bar"



The url should probably be in a redirect coming from a UI action or something like that.



And then on the schedule page in the HTML field you can write this:



<input type="hidden" id="sysparm_parm1" value="${sysparm_parm1}" />


<input type="hidden" id="sysparm_parm2" value="${sysparm_parm2}" />



Then in the client script section of the schedule page should set your values:



var myparm1   = gel('sysparm_parm1').value;


var myparm2 = gel('sysparm_parm2').value;




Having been a while since this post, it might be more elegant to do this in a UI action:



gs.getSession().putClientData('parameter1', myvalue);



And then in the schedule page client script section put this:



var myparm1 = gs.getSession().getClientData('parameter1')