# OnCreateSchedule

**URL:** <https://forum.inductiveautomation.com/t/oncreateschedule/17288>\
**Category:** Ignition\
**Created:** [March 9, 2018, 5:23am UTC](https://forum.inductiveautomation.com/t/oncreateschedule/17288 "2018-03-09T05:23:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bsilva621](https://avatars.discourse-cdn.com/v4/letter/b/c89c15/32.png) [@bsilva621](https://forum.inductiveautomation.com/u/bsilva621)\
**Post date:** [March 9, 2018, 5:23am UTC](https://forum.inductiveautomation.com/t/oncreateschedule/17288/1 "2018-03-09T05:23:39Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![bfuson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bfuson/32/4597_2.png) [@bfuson](https://forum.inductiveautomation.com/u/bfuson)\
**Post date:** [March 9, 2018, 4:04pm UTC](https://forum.inductiveautomation.com/t/oncreateschedule/17288/2 "2018-03-09T16:04:18Z")

</div>

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

```auto
"
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:

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

```
