Problem loading Custom Property dataset in Event Handler

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:

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", "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(,0,data)
 		event.source.getComponent('tblHolder').data = holder = holder
	data = {}
	holder = system.dataset.updateRow(,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 object, it seems to work fine.

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

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.

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