OnCreateSchedule

Hi folks,

Very green Ignition user here. Actually this is my first project and I’m just setting up a user scheduling list being specifically used for some alarm pipelines. What I’m after seems rather basic but I’m having a hard time following syntax. I want to basically disable the ability to add new schedules using the admin schedule management component. I figured out how to filter based on known list but cannot get this last part down. I found the OnCreateSchedule extension function but cannot get it to work in any shape or fashion despite no errors being flagged. Does anyone have a sample snippet to share here, I would surely appreciate it!

Take a look at the included comments within the onSaveSchedule extension function, particularly the argument descriptions:

"
saveContext: An object that can be used to reject the edit by calling saveContext.rejectSave('reason')
oldName: The schedule name before editing. Will be None for a schedule being added.
"

So you should add code similar to this in the extension function:

	if oldName == None:
		saveContext.rejectSave('Adding new schedules is forbidden.')
		return
1 Like