# Equipment Schedule refresh help

**URL:** <https://forum.inductiveautomation.com/t/equipment-schedule-refresh-help/18490>\
**Category:** Ignition\
**Created:** [June 15, 2018, 11:45pm UTC](https://forum.inductiveautomation.com/t/equipment-schedule-refresh-help/18490 "2018-06-15T23:45:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brian](https://avatars.discourse-cdn.com/v4/letter/b/97f17d/32.png) [@Brian](https://forum.inductiveautomation.com/u/Brian)\
**Post date:** [June 15, 2018, 11:45pm UTC](https://forum.inductiveautomation.com/t/equipment-schedule-refresh-help/18490/1 "2018-06-15T23:45:42Z")

</div>

I’m having trouble refreshing the Equipment Schedule component via scripting. I currently have the Scheduled Items dataset bound to a SQL query, with the polling mode set to absolute and a relatively long time period (normally a couple minutes, for testing I set it to 30 seconds or so).

I’m trying to add event resizing features to the component, and I have the scripting figured out for updating the underlying SQL table, but the event will snap back to the old size until the component refreshes on it’s internal timer. I tried doing a system.db.refresh on the component dataset, but I’m getting an error. Not sure how to proceed.

Here’s the code I have in the onEventResized event:

```auto
        #Setup an update query to modify the load time range
	db = 'postgres'
	query = "UPDATE tiny_loads SET load_timerange = tstzrange(?::timestamptz,?::timestamptz) WHERE id = ?::integer;"
	newStartDateObject = system.date.parse(newStartDate)
	newStartDate = system.date.format(newStartDateObject,"yyyy-MM-dd HH:mm:ssX")
	newEndDateObject = system.date.parse(newEndDate)
	newEndDate = system.date.format(newEndDateObject,"yyyy-MM-dd HH:mm:ssX")
	args = [newStartDate, newEndDate, eventId]
	system.db.runPrepUpdate(query, args, db)
	system.db.refresh(self,"Scheduled Events")

```

And here’s the error it’s spitting out:

```auto
18:45:08.147 [AWT-EventQueue-0] WARN com.inductiveautomation.factorypmi.application.components.EquipmentScheduleView - system.db.refresh() was unable to find a refresh-compatible property binding on Equipment Schedule.Scheduled Events

```

Any thoughts?

---

<div class="post-metadata">

**Author:** ![Stuart](https://avatars.discourse-cdn.com/v4/letter/s/cab0a1/32.png) [@Stuart](https://forum.inductiveautomation.com/u/Stuart)\
**Post date:** [June 16, 2018, 12:57am UTC](https://forum.inductiveautomation.com/t/equipment-schedule-refresh-help/18490/2 "2018-06-16T00:57:26Z")

</div>

You need to use the scripting name of the property. In this case, `scheduledEvents`.

```auto
system.db.refresh(self,"scheduledEvents")

```

Check out the table in the manual: [https://docs.inductiveautomation.com/display/DOC79/Equipment+Schedule](https://docs.inductiveautomation.com/display/DOC79/Equipment+Schedule)

I haven’t read through the rest of your code, but this should at least fix that error.

---

<div class="post-metadata">

**Author:** ![Brian](https://avatars.discourse-cdn.com/v4/letter/b/97f17d/32.png) [@Brian](https://forum.inductiveautomation.com/u/Brian)\
**Post date:** [June 16, 2018, 4:56pm UTC](https://forum.inductiveautomation.com/t/equipment-schedule-refresh-help/18490/3 "2018-06-16T16:56:52Z")

</div>

Thanks! I now have proof my decision to go home for the night was the right one. I was looking at that exact page, but never saw the entry. 😅
