Text Field Script Error - Multiple Entries - Defer Update?

I have a text field for entering a barcode and we are trying to use it for 3 different barcodes. On the first scan it works perfectly. When the correct 1st scan barcode is received, the POI table is populated, searched, and Dynamic Property BasicSC or PremiumSC and OCvalve or CCvalve is set to TRUE.

ISSUE: Once the correct 1st scan is received, the text field acts like the Defer Updates was set to false. I think it’s a code issue. Here is my event “keytyped” code:

text = event.source.text
text2 = event.source.text[7:15]

if event.source.parent.getComponent('POI').BasicSC or event.source.parent.getComponent('POI').PremiumSC:

	if text == '11076709' and event.source.parent.getComponent('POI').OCvalve:
		event.source.parent.getComponent('IND Valve Scan Status').Pass = 1
		event.source.parent.getComponent('IND Valve Scan Status').Fail = 0

	elif text == '11058800' and event.source.parent.getComponent('POI').CCvalve:
		event.source.parent.getComponent('IND Valve Scan Status').Pass = 1
		event.source.parent.getComponent('IND Valve Scan Status').Fail = 0
		
	elif text2 == 'AL202447' and event.source.parent.getComponent('POI').BasicSC:
		event.source.parent.getComponent('IND Column Scan Status').Pass = 1
		event.source.parent.getComponent('IND Column Scan Status').Fail = 0

	elif text2 == 'AL202446' and event.source.parent.getComponent('POI').PremiumSC:
		event.source.parent.getComponent('IND Column Scan Status').Pass = 1
		event.source.parent.getComponent('IND Column Scan Status').Fail = 0

	else:
		event.source.parent.getComponent('IND Column Scan Status').Pass = 0
		event.source.parent.getComponent('IND Column Scan Status').Fail = 1
		event.source.parent.getComponent('IND Valve Scan Status').Pass = 0
		event.source.parent.getComponent('IND Valve Scan Status').Fail = 1
		system.gui.warningBox('Invalid scan received, please rescan both components.','Error Message')

else:
	event.source.parent.getComponent('POI').Serial = text

event.source.text = ''

Any assistance would be appreciated. Thanks!

You are using the keyTyped event on the component. That event doesn’t pay attention to the Defer Updates property. It fires the event anytime a key was typed on the component. If you want to wait until the user finishes put the script on a propertyChange event like the following:if event.propertyName == "text": do your codeThe propertyChange event does respect the Defer Updates property.