Returns a sequence of all available schedule models, which can be used to return configuration information on the schedule, such as time for each day of the week.


This scripting function has no Client Permission restrictions.


system.user.getSchedules()

  • Parameters

none

  • Returns

List - A list of ScheduleModel objects. ScheduleModel objects can be a Basic Schedule, Composite Schedule (composed of exactly two other schedules), or another type registered by a module.

  • Scope

All




# This example will print a list of all available ScheduleModels:
 
# This function handles recursive printing of the different schedule models. Modules can register more types than listed here.
def printScheduleInfo(aSchedule):
	if aSchedule.getType() == "basic schedule": 
		print "Basic schedule type: ",aSchedule.getName(), aSchedule.getDescription(), aSchedule.isAllDays(), aSchedule.getAllDayTime()
	elif aSchedule.getType() == "composite schedule":
		compositePieces = aSchedule.getModels()
		print "Composite schedule type:",aSchedule.getName(), aSchedule.getDescription(), " which is made up of..."
		for piece in compositePieces:
			printScheduleInfo(piece)
	else:
		print "Other schedule type: ", aSchedule.getName(), aSchedule.getDescription(), aSchedule.getType(), aSchedule.isObserveHolidays()


# The main function
schedules = system.user.getSchedules()
for schedule in schedules:
	printScheduleInfo(schedule)


Basic schedule type:  A None True 0:00-24:00
Basic schedule type:  Always Built-in schedule that is always available: 24x7x365 True 0:00-24:00
Basic schedule type:  B None True 0:00-24:00
Basic schedule type:  C None True 0:00-24:00
Basic schedule type:  Example An example of a M-F 8am-5pm schedule with a lunch break False 0:00-24:00
Composite schedule type: MyComposite a composite schedule  which is made up of...
Basic schedule type:  A None True 0:00-24:00
Basic schedule type:  B None True 0:00-24:00
Basic schedule type:  MySchedule A description False 0:00-24:00