# Problem loading Custom Property dataset in Event Handler

**URL:** <https://forum.inductiveautomation.com/t/problem-loading-custom-property-dataset-in-event-handler/6254>\
**Category:** Ignition\
**Created:** [April 17, 2013, 7:03pm UTC](https://forum.inductiveautomation.com/t/problem-loading-custom-property-dataset-in-event-handler/6254 "2013-04-17T19:03:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeffhoagland](https://avatars.discourse-cdn.com/v4/letter/j/dc4da7/32.png) [@jeffhoagland](https://forum.inductiveautomation.com/u/jeffhoagland)\
**Post date:** [April 17, 2013, 7:03pm UTC](https://forum.inductiveautomation.com/t/problem-loading-custom-property-dataset-in-event-handler/6254/1 "2013-04-17T19:03:30Z")

</div>

I downloaded the scripting module (extremely cool set of tools there, btw) and have started adapting the screen “IA\_Example\_SQLTagsAlarmStatesEdit” to convert it over to make it compatible with Ignition in order to support a project I’m doing to enable users to reconfigure/adjust Alarm tags when the need arises (this is expected because of the way the tags are being generated, they’ll start off in the project almost blank).

to drive this I’m using a query of the Alarm Log in my MSSQL database to filter through the tags and find the ones that need to be updated (for now anyway, later, this will be driven by a button on a different screen, but I’m still in the early development stages).

Once I’ve found the tags, then I can select 1 tag, and it’s relevant information (tagname, tagpath, Available Tags row ID)will get copied from the “Available Tags” window to some custom properties that will be read from all over the screen by different components.

I’ve made it to where i can drive the Data property of a table, but I’d rather use a custom property-\>dataset to do this instead, however, when I try to use:

```auto
if event.source.selectedTagID != -1:
	# Need a translator that can build the data for the data table into a dataset that can then be fed to the table
	states = system.tag.getAlarmStates(event.source.parent.getComponent('AvailableTags').getComponent('Tags').Path)
	# 'states' contains all the valid Alarm States needed to populate the data used by this window (and then some, most probably)
	data = {}
	for state in states:
		data = {"name":state.name, "severity":state.severity, "timeDeadband":state.timeDeadband, "timeDeadbandUnits":state.timeDeadbandUnits, "flags":state.flags, "loLimit":state.loLimit, "hiLimit":state.hiLimit, "loTagPath":state.loTagPath, "hiTagPath":state.hiTagPath}
 		holder = system.dataset.updateRow(event.source.as,0,data)
 		event.source.getComponent('tblHolder').data = holder
 		event.source.as = holder
else:
	data = {}
	holder = system.dataset.updateRow(event.source.as,0,data)
	event.source.getComponent('tblHolder').data = holder
```

my designer locks up completely.

When I do the same thing, but send the data to a Table.data object, it seems to work fine.

I can’t seem to figure out what I’m doing wrong, can someone help?

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [May 21, 2013, 8:46pm UTC](https://forum.inductiveautomation.com/t/problem-loading-custom-property-dataset-in-event-handler/6254/2 "2013-05-21T20:46:45Z")

</div>

My guess is you’re causing an infinite loop. I’m not sure when this script is running, but maybe something this script is doing is causing it to run again, which would cause such a loop.

---

<div class="post-metadata">

**Author:** ![jeffhoagland](https://avatars.discourse-cdn.com/v4/letter/j/dc4da7/32.png) [@jeffhoagland](https://forum.inductiveautomation.com/u/jeffhoagland)\
**Post date:** [May 21, 2013, 8:50pm UTC](https://forum.inductiveautomation.com/t/problem-loading-custom-property-dataset-in-event-handler/6254/3 "2013-05-21T20:50:21Z")

</div>

Ok, thanks - I’ll take another crack at it with that in mind
