# Java Lang Error on actionPerformed Button

**URL:** <https://forum.inductiveautomation.com/t/java-lang-error-on-actionperformed-button/72827>\
**Category:** Ignition\
**Tags:** vision, ignition81, scripting\
**Created:** [April 24, 2023, 3:49pm UTC](https://forum.inductiveautomation.com/t/java-lang-error-on-actionperformed-button/72827 "2023-04-24T15:49:30Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ashlea\_Brown](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@Ashlea\_Brown](https://forum.inductiveautomation.com/u/Ashlea_Brown)\
**Post date:** [April 24, 2023, 3:49pm UTC](https://forum.inductiveautomation.com/t/java-lang-error-on-actionperformed-button/72827/1 "2023-04-24T15:49:30Z")

</div>

I am using a script on a button actionPerformed to submit change modifications to a change log. When I run it in the vision client launcher, I keep getting errors. Does anyone know a solution to this issue?

These are my versions of Ignition and Java:  
Ignition v8.1.7 (b2021060314)  
Java: Azul Systems, Inc. 11.0.11

Button Script:

```auto
# This script was generated automatically by the update query
# script builder. You may modify this script, but if you do,
# you will not be able to use the update query builder to update
# this script without overwriting your changes.

#ID of request pulled from change request text field. That field is autopopulated with the next highest available ID number
id = event.source.parent.getComponent('Change Request ID Text Field').intValue

#request date pulls current time on server
reqDate = system.date.now()

#impDate set by user
impDate = event.source.parent.getComponent('Date Implemented Cal').date

#user selected temporary change
temp = event.source.parent.getComponent('Temp Change CheckBox').selected

#if change is temporary use user selected data. if not temporary, value null
if temp == 1:
	revDate = event.source.parent.getComponent('Date Reverted Cal').date
else:
	revDate = None

#set initial status to implemented unless already reverted temporary change
if temp == 1 and revDate < reqDate:
	status = "Reverted"
else: 
	status = "Implemented"

#initiator autofills with active user but can be changed - text field
initiator = event.source.parent.getComponent('Initiator Text Field').text

#department will determine who approves/gets notified - dropdown
department = event.source.parent.getComponent('Department Dropdown').selectedLabel

#available areas determined by department selection - dropdown
area = event.source.parent.getComponent('Area Dropdown').selectedLabel

#description of the change made - text area
description = event.source.parent.getComponent('Description Text Area').text

#justification for change being made - text area
justification = event.source.parent.getComponent('Justification Text Area').text

#SOP change? -checkbox
sop = event.source.parent.getComponent('SOP CheckBox').selected

#recipe/raw material change - checkbox
recipe = event.source.parent.getComponent('Recipe CheckBox').selected

#process parameter change - checkbox
parameter = event.source.parent.getComponent('Parameter Checkbox').selected

#physical equipment mod - checkbox
physical = event.source.parent.getComponent('Equipment Checkbox').selected

#change impacting occupational safety - checkbox
ocSafe = event.source.parent.getComponent('OcSafety Checkbox').selected

#change to chemical type or handling - checkbox
chem = event.source.parent.getComponent('Chemical Check Box').selected

#programming change/HMI change/sensor change - checkbox
automation = event.source.parent.getComponent('Automation Checkbox').selected

#does the change bypass a safety function/protocol - checkbox
safetyBypass = event.source.parent.getComponent('Safety Bypass Checkbox').selected

system.nav.closeParentWindow(event)

##conditions requiring production approval
#if sop == 1 or recipe == 1 or parameter == 1 or physical == 1 or chem == 1 or automation == 1 or ocSafe == 1 or safetyBypass == 1:
#	productionreq = 1
#else:
#	productionreq = 0
#
##conditions requiring safety approval
#if chem == 1 or ocSafe == 1 or safetyBypass == 1:
#	safetyreq = 1
#else: safetyreq = 0
#
##conditions requiring engineering approval
#if recipe == 1 or parameter == 1 or physical == 1 or chem == 1 or automation == 1 or safetyBypass == 1:
#	engineeringreq = 1
#else:
#	engineeringreq = 0
#
##conditions requiring quality notification
#if recipe == 1:
#	qualitynote = 1
#else:
#	qualitynote = 0
#
##conditions requiring maintenance notification
#maintenancenote = 1

prodApprover = "test"
prodDate = system.date.now()
engrApprover = "test"
engrDate = system.date.now()
safeApprover = "test"
safeDate = system.date.now()
finalApproval = 0
finalDate = system.date.now()

system.db.runNamedQuery("UpdateChangeRequest", {"RequestStatus":status, "DateImplemented":impDate, "Temporary":temp, "DateReverted":revDate, "Initiator":initiator, 
"Department":department, "Area":area, "Description":description, "Justification":justification, "SOP":sop , "Recipe":recipe, "Parameter":parameter, "Physical":physical,
"OcSafety":ocSafe,"SafetyBypass":safetyBypass,"Chemical":chem ,"Automation":automation, "ApproverProd":prodApprover,"ApproverProdDate":prodDate,"ApproverEngr":engrApprover,
"ApproverEngrDate":engrDate,"ApproverSafe":safeApprover,"ApproverSafeDate":safeDate,"ApprovalFinal":finalApproval, "DateApproved":finalDate,"ChangeReq":id})

##creates email address of initiator
initiatorEmail = initiator + "@stonebrewing.com"

##sets up list for the notification report to go out to
distribution = [initiatorEmail]

#adds production notification to the list dependent on what department was selected
if productionreq == 1 and department == "Brewing":
	distribution.append("nicole.williams@stonebrewing.com")
elif productionreq == 1 and department == "Packaging":
	distribution.append("nicole.williams@stonebrewing.com")
elif productionreq == 1 and department == "Water Rec":
	distribution.append("nicole.williams@stonebrewing.com")	
elif productionreq == 1 and department == "Escondido Production":
	distribution.append("nicole.williams@stonebrewing.com")

#adds other relevant notifications to the distribution list				
if engineeringreq == 1:
	distribution.append("nicole.williams@stonebrewing.com")
if safetyreq == 1:
	distribution.append("nicole.williams@stonebrewing.com")	
if qualitynote == 1:
	distribution.append("nicole.williams@stonebrewing.com")	
if maintenancenote == 1:
	distribution.append("nicole.williams@stonebrewing.com")
	
#establishes email contents
emailSubject = "Change Notification #" + str(id)
emailBody = "User: " + initiator + " <br/> " + "Department: " + department + " <br/> " + "Area: " + area + " <br/> " + "Description: " + description
emailSettings = {"to":distribution, "smtpServerName":"StoneEmail", "from":"ignition_alerts@stonebrewing.com", "subject":emailSubject, "body":emailBody}

#emails out the report
reportParameters = {"changeid":str(id),"initiator":initiator,"date":impDate,"temporary":temp,"department":department,"area":area,"description":description,"justification":justification,
"sop":sop,"recipe":recipe,"parameter":parameter,"physical":physical,"ocsafety":ocSafe,"chemicals":chem,"automation":automation,"safetybypass":safetyBypass}
system.report.executeAndDistribute(path="Change Notification", project="HMI", parameters = reportParameters, action= "email", 
  actionSettings = emailSettings)

#system.db.refresh(event.source.parent.getComponent('Power Table'),"data")

```

Error thread:

```auto
Traceback (most recent call last):
  File "<event:actionPerformed>", line 25, in <module>
java.lang.NullPointerException
	at java.base/java.util.Date.getMillisOf(Unknown Source)
	at java.base/java.util.Date.compareTo(Unknown Source)
	at java.base/java.util.Date.compareTo(Unknown Source)
	at org.python.core.PyJavaType$ComparableMethod. __call__ (PyJavaType.java:916)
	at org.python.core.PyObjectDerived. __gt__ (PyObjectDerived.java:560)
	at org.python.core.PyObject._lt(PyObject.java:1648)
	at org.python.pycode._pyx16.f$0(<event:actionPerformed>:147)
	at org.python.pycode._pyx16.call_function(<event:actionPerformed>)
	at org.python.core.PyTableCode.call(PyTableCode.java:171)
	at org.python.core.PyCode.call(PyCode.java:18)
	at org.python.core.Py.runCode(Py.java:1614)
	at com.inductiveautomation.ignition.common.script.ScriptManager.runCode(ScriptManager.java:799)
	at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.runActions(ActionAdapter.java:206)
	at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.invoke(ActionAdapter.java:297)
	at com.inductiveautomation.factorypmi.application.binding.action.RelayInvocationHandler.invoke(RelayInvocationHandler.java:57)
	at com.sun.proxy.$Proxy45.actionPerformed(Unknown Source)
	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
	at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
	at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
	at java.desktop/javax.swing.DefaultButtonModel.setPressed(Unknown Source)
	at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
	at java.desktop/java.awt.Component.processMouseEvent(Unknown Source)
	at java.desktop/javax.swing.JComponent.processMouseEvent(Unknown Source)
	at java.desktop/java.awt.Component.processEvent(Unknown Source)
	at java.desktop/java.awt.Container.processEvent(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)
java.lang.NullPointerException: java.lang.NullPointerException

	at org.python.core.Py.JavaError(Py.java:552)
	at org.python.core.PyTableCode.call(PyTableCode.java:180)
	at org.python.core.PyCode.call(PyCode.java:18)
	at org.python.core.Py.runCode(Py.java:1614)
	at com.inductiveautomation.ignition.common.script.ScriptManager.runCode(ScriptManager.java:799)
	at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.runActions(ActionAdapter.java:206)
	at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.invoke(ActionAdapter.java:297)
	at com.inductiveautomation.factorypmi.application.binding.action.RelayInvocationHandler.invoke(RelayInvocationHandler.java:57)
	at com.sun.proxy.$Proxy45.actionPerformed(Unknown Source)
	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
	at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
	at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
	at java.desktop/javax.swing.DefaultButtonModel.setPressed(Unknown Source)
	at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
	at java.desktop/java.awt.Component.processMouseEvent(Unknown Source)
	at java.desktop/javax.swing.JComponent.processMouseEvent(Unknown Source)
	at java.desktop/java.awt.Component.processEvent(Unknown Source)
	at java.desktop/java.awt.Container.processEvent(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.NullPointerException
	at java.base/java.util.Date.getMillisOf(Unknown Source)
	at java.base/java.util.Date.compareTo(Unknown Source)
	at java.base/java.util.Date.compareTo(Unknown Source)
	at org.python.core.PyJavaType$ComparableMethod. __call__ (PyJavaType.java:916)
	at org.python.core.PyObjectDerived. __gt__ (PyObjectDerived.java:560)
	at org.python.core.PyObject._lt(PyObject.java:1648)
	at org.python.pycode._pyx16.f$0(<event:actionPerformed>:147)
	at org.python.pycode._pyx16.call_function(<event:actionPerformed>)
	at org.python.core.PyTableCode.call(PyTableCode.java:171)
	... 42 more

Ignition v8.1.7 (b2021060314)
Java: Azul Systems, Inc. 11.0.11

```

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [April 24, 2023, 3:53pm UTC](https://forum.inductiveautomation.com/t/java-lang-error-on-actionperformed-button/72827/2 "2023-04-24T15:53:47Z")

</div>

> [@Ashlea\_Brown](#):
>
> ```auto
> #set initial status to implemented unless already reverted temporary change
> if temp == 1 and revDate < reqDate:
> 
> ```

One of these is `null` / `None`.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [April 24, 2023, 4:21pm UTC](https://forum.inductiveautomation.com/t/java-lang-error-on-actionperformed-button/72827/3 "2023-04-24T16:21:08Z")

</div>

Most likely `revDate`, which value comes from a component.  
I can't imagine `system.date.now()` returning `None`.

---

<div class="post-metadata">

**Author:** ![Ashlea\_Brown](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@Ashlea\_Brown](https://forum.inductiveautomation.com/u/Ashlea_Brown)\
**Post date:** [April 24, 2023, 4:52pm UTC](https://forum.inductiveautomation.com/t/java-lang-error-on-actionperformed-button/72827/4 "2023-04-24T16:52:45Z")

</div>

So basically what I am trying to do is make my second script email out to my team. I am trying to edit this script which was previously written by another engineer and I am a little lost. This is the original script which writes to a table (the change log)

```auto
# This script was generated automatically by the update query
# script builder. You may modify this script, but if you do,
# you will not be able to use the update query builder to update
# this script without overwriting your changes.

#ID of request pulled from change request text field. That field is autopopulated with the next highest available ID number
id = event.source.parent.getComponent('Change Request ID Text Field').intValue

#request date pulls current time on server
reqDate = system.date.now()

#impDate set by user
impDate = event.source.parent.getComponent('Date Implemented Cal').date

#user selected temporary change
temp = event.source.parent.getComponent('Temp Change CheckBox').selected

#if change is temporary use user selected data. if not temporary, value null
if temp == 1:
	revDate = event.source.parent.getComponent('Date Reverted Cal').date
else:
	revDate = None

#set initial status to implemented unless already reverted temporary change
if temp == 1 and revDate < reqDate:
	status = "Reverted"
else: 
	status = "Implemented"

#initiator autofills with active user but can be changed - text field
initiator = event.source.parent.getComponent('Initiator Text Field').text

#department will determine who approves/gets notified - dropdown
department = event.source.parent.getComponent('Department Dropdown').selectedLabel

#available areas determined by department selection - dropdown
area = event.source.parent.getComponent('Area Dropdown').selectedLabel

#description of the change made - text area
description = event.source.parent.getComponent('Description Text Area').text

#justification for change being made - text area
justification = event.source.parent.getComponent('Justification Text Area').text

#SOP change? -checkbox
sop = event.source.parent.getComponent('SOP CheckBox').selected

#recipe/raw material change - checkbox
recipe = event.source.parent.getComponent('Recipe CheckBox').selected

#process parameter change - checkbox
parameter = event.source.parent.getComponent('Parameter Checkbox').selected

#physical equipment mod - checkbox
physical = event.source.parent.getComponent('Equipment Checkbox').selected

#change impacting occupational safety - checkbox
ocSafe = event.source.parent.getComponent('OcSafety Checkbox').selected

#change to chemical type or handling - checkbox
chem = event.source.parent.getComponent('Chemical Check Box').selected

#programming change/HMI change/sensor change - checkbox
automation = event.source.parent.getComponent('Automation Checkbox').selected

#does the change bypass a safety function/protocol - checkbox
safetyBypass = event.source.parent.getComponent('Safety Bypass Checkbox').selected
#
#system.db.refresh(event.source.parent.getComponent('Power Table'),"data")
system.nav.closeParentWindow(event)

#conditions requiring production approval
if sop == 1 or recipe == 1 or parameter == 1 or physical == 1 or chem == 1 or automation == 1 or ocSafe == 1 or safetyBypass == 1:
	productionreq = 1
else:
	productionreq = 0

#conditions requiring safety approval
if chem == 1 or ocSafe == 1 or safetyBypass == 1:
	safetyreq = 1
else: safetyreq = 0

#conditions requiring engineering approval
if recipe == 1 or parameter == 1 or physical == 1 or chem == 1 or automation == 1 or safetyBypass == 1:
	engineeringreq = 1
else:
	engineeringreq = 0

#conditions requiring quality notification
if recipe == 1:
	qualitynote = 1
else:
	qualitynote = 0

#conditions requiring maintenance notification
if parameter == 1 or physical == 1 or ocSafe == 1 or automation == 1 or safetyBypass == 1:
	maintenancenote = 1
else:
	maintenancenote = 0

#named query adds data from the form to the database as a new row
system.db.runNamedQuery("NewChangeRequest", {"ChangeReq":id, "DateRequested":reqDate, "RequestStatus":status, "DateImplemented":impDate, "Temporary":temp, "DateReverted":revDate, 
"Initiator":initiator, "Department":department, "Area":area, "Description":description, "Justification":justification,"SOP":sop, "Recipe":recipe, "Parameter":parameter, "Physical":physical, 
"OcSafety":ocSafe, "SafetyBypass":safetyBypass, "Chemical":chem, "Automation":automation, "ReqProduction":productionreq, "ReqSafety":safetyreq, "ReqEngineering":engineeringreq})

#creates email address of initiator
initiatorEmail = initiator + "@stonebrewing.com"

#sets up list for the notification report to go out to
distribution = [initiatorEmail]

#adds production notification to the list dependent on what department was selected
if productionreq == 1 and department == "Brewing":
	brewing = event.source.parent.Approvers.getValueAt(0,2)
	distribution.append(brewing)
elif productionreq == 1 and department == "Packaging":
	packaging = event.source.parent.Approvers.getValueAt(1,2)
	distribution.append(packaging)
elif productionreq == 1 and department == "Water Rec":
	water = event.source.parent.Approvers.getValueAt(2,2)
	distribution.append(water)	
elif productionreq == 1 and department == "Escondido Production":
	prod = event.source.parent.Approvers.getValueAt(3,2)
	distribution.append(prod)

#adds other relevant notifications to the distribution list				
if engineeringreq == 1:
	engineer = event.source.parent.Approvers.getValueAt(5,2)
	distribution.append(engineer)
if safetyreq == 1:
	safety = event.source.parent.Approvers.getValueAt(4,2)
	distribution.append(safety)	
if qualitynote == 1:
	quality = event.source.parent.Approvers.getValueAt(6,2)
	distribution.append(quality)	
if maintenancenote == 1:
	maint = event.source.parent.Approvers.getValueAt(7,2)
	distribution.append(maint)
	
#establishes email contents
emailSubject = "Change Notification #" + str(id)
emailBody = "User: " + initiator + " <br/> " + "Department: " + department + " <br/> " + "Area: " + area + " <br/> " + "Description: " + description
emailSettings = {"to":distribution, "smtpServerName":"StoneEmail", "from":"ignition_alerts@stonebrewing.com", "subject":emailSubject, "body":emailBody}

#emails out the report
reportParameters = {"changeid":str(id),"initiator":initiator,"date":impDate,"temporary":temp,"department":department,"area":area,"description":description,"justification":justification,
"sop":sop,"recipe":recipe,"parameter":parameter,"physical":physical,"ocsafety":ocSafe,"chemicals":chem,"automation":automation,"safetybypass":safetyBypass}
system.report.executeAndDistribute(path="Change Notification", project="Packaging", parameters = reportParameters, action= "email", 
  actionSettings = emailSettings)

```

Now I keep getting the error that 'productionreq' is not defined but I put it into my named query and into the script so I dont understand why it says its not defined.

Current Script:

```auto
# This script was generated automatically by the update query
# script builder. You may modify this script, but if you do,
# you will not be able to use the update query builder to update
# this script without overwriting your changes.

#ID of request pulled from change request text field. That field is autopopulated with the next highest available ID number
id = event.source.parent.getComponent('Change Request ID Text Field').intValue

#request date pulls current time on server
reqDate = system.date.now()

#impDate set by user
impDate = event.source.parent.getComponent('Date Implemented Cal').date

#user selected temporary change
temp = event.source.parent.getComponent('Temp Change CheckBox').selected

#if change is temporary use user selected data. if not temporary, value null
if temp == 1:
	revDate = event.source.parent.getComponent('Date Reverted Cal').date
else:
	revDate = None

#set initial status to implemented unless already reverted temporary change
if temp == 1 and revDate < reqDate:
	status = "Reverted"
else: 
	status = "Implemented"

#initiator autofills with active user but can be changed - text field
initiator = event.source.parent.getComponent('Initiator Text Field').text

#department will determine who approves/gets notified - dropdown
department = event.source.parent.getComponent('Department Dropdown').selectedLabel

#available areas determined by department selection - dropdown
area = event.source.parent.getComponent('Area Dropdown').selectedLabel

#description of the change made - text area
description = event.source.parent.getComponent('Description Text Area').text

#justification for change being made - text area
justification = event.source.parent.getComponent('Justification Text Area').text

#SOP change? -checkbox
sop = event.source.parent.getComponent('SOP CheckBox').selected

#recipe/raw material change - checkbox
recipe = event.source.parent.getComponent('Recipe CheckBox').selected

#process parameter change - checkbox
parameter = event.source.parent.getComponent('Parameter Checkbox').selected

#physical equipment mod - checkbox
physical = event.source.parent.getComponent('Equipment Checkbox').selected

#change impacting occupational safety - checkbox
ocSafe = event.source.parent.getComponent('OcSafety Checkbox').selected

#change to chemical type or handling - checkbox
chem = event.source.parent.getComponent('Chemical Check Box').selected

#programming change/HMI change/sensor change - checkbox
automation = event.source.parent.getComponent('Automation Checkbox').selected

#does the change bypass a safety function/protocol - checkbox
safetyBypass = event.source.parent.getComponent('Safety Bypass Checkbox').selected

system.nav.closeParentWindow(event)

#conditions requiring production approval
if sop == 1 or recipe == 1 or parameter == 1 or physical == 1 or chem == 1 or automation == 1 or ocSafe == 1 or safetyBypass == 1:
	productionreq = 1
else:
	productionreq = 0

#conditions requiring safety approval
if chem == 1 or ocSafe == 1 or safetyBypass == 1:
	safetyreq = 1
else: safetyreq = 0

#conditions requiring engineering approval
if recipe == 1 or parameter == 1 or physical == 1 or chem == 1 or automation == 1 or safetyBypass == 1:
	engineeringreq = 1
else:
	engineeringreq = 0

#conditions requiring quality notification
if recipe == 1:
	qualitynote = 1
else:
	qualitynote = 0

#conditions requiring maintenance notification
maintenancenote = 1

#prodApprover = "test"
#prodDate = system.date.now()
#engrApprover = "test"
#engrDate = system.date.now()
#safeApprover = "test"
#safeDate = system.date.now()
#finalApproval = 0
#finalDate = system.date.now()

system.db.runNamedQuery("UpdateChangeRequest", {"RequestStatus":status, "DateImplemented":impDate, "Temporary":temp, "DateReverted":revDate, "Initiator":initiator, 
"Department":department, "Area":area, "Description":description, "Justification":justification, "SOP":sop , "Recipe":recipe, "Parameter":parameter, "Physical":physical,
"OcSafety":ocSafe,"SafetyBypass":safetyBypass,"Chemical":chem ,"Automation":automation, "ReqProduction":productionreq, "ApproverProd":prodApprover,"ApproverProdDate":prodDate,"ApproverEngr":engrApprover,
"ApproverEngrDate":engrDate,"ApproverSafe":safeApprover,"ApproverSafeDate":safeDate,"ApprovalFinal":finalApproval, "DateApproved":finalDate, "ReqProduction":productionreq, "ChangeReq":id})

##creates email address of initiator
initiatorEmail = initiator + "@stonebrewing.com"

##sets up list for the notification report to go out to
distribution = [initiatorEmail]

#adds production notification to the list dependent on what department was selected
if productionreq == 1 and department == "Brewing":
	distribution.append("nicole.williams@stonebrewing.com")
elif productionreq == 1 and department == "Packaging":
	distribution.append("nicole.williams@stonebrewing.com")
elif productionreq == 1 and department == "Water Rec":
	distribution.append("nicole.williams@stonebrewing.com")	
elif productionreq == 1 and department == "Escondido Production":
	distribution.append("nicole.williams@stonebrewing.com")

#adds other relevant notifications to the distribution list				
if engineeringreq == 1:
	distribution.append("nicole.williams@stonebrewing.com")
if safetyreq == 1:
	distribution.append("nicole.williams@stonebrewing.com")	
if qualitynote == 1:
	distribution.append("nicole.williams@stonebrewing.com")	
if maintenancenote == 1:
	distribution.append("nicole.williams@stonebrewing.com")
	
#establishes email contents
emailSubject = "Change Notification #" + str(id)
emailBody = "User: " + initiator + " <br/> " + "Department: " + department + " <br/> " + "Area: " + area + " <br/> " + "Description: " + description
emailSettings = {"to":distribution, "smtpServerName":"StoneEmail", "from":"ignition_alerts@stonebrewing.com", "subject":emailSubject, "body":emailBody}

#emails out the report
reportParameters = {"changeid":str(id),"initiator":initiator,"date":impDate,"temporary":temp,"department":department,"area":area,"description":description,"justification":justification,
"sop":sop,"recipe":recipe,"parameter":parameter,"physical":physical,"ocsafety":ocSafe,"chemicals":chem,"automation":automation,"safetybypass":safetyBypass}
system.report.executeAndDistribute(path="Change Notification", project="HMI", parameters = reportParameters, action= "email", 
  actionSettings = emailSettings)

#system.db.refresh(event.source.parent.getComponent('Power Table'),"data")

```

Error thread:

```auto
Traceback (most recent call last):
  File "<event:actionPerformed>", line 120, in <module>
NameError: name 'productionreq' is not defined

	at org.python.core.Py.NameError(Py.java:290)
	at org.python.core.PyFrame.getname(PyFrame.java:257)
	at org.python.pycode._pyx16.f$0(<event:actionPerformed>:147)
	at org.python.pycode._pyx16.call_function(<event:actionPerformed>)
	at org.python.core.PyTableCode.call(PyTableCode.java:171)
	at org.python.core.PyCode.call(PyCode.java:18)
	at org.python.core.Py.runCode(Py.java:1614)
	at com.inductiveautomation.ignition.common.script.ScriptManager.runCode(ScriptManager.java:799)
	at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.runActions(ActionAdapter.java:206)
	at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.invoke(ActionAdapter.java:297)
	at com.inductiveautomation.factorypmi.application.binding.action.RelayInvocationHandler.invoke(RelayInvocationHandler.java:57)
	at com.sun.proxy.$Proxy45.actionPerformed(Unknown Source)
	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
	at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
	at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
	at java.desktop/javax.swing.DefaultButtonModel.setPressed(Unknown Source)
	at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
	at java.desktop/java.awt.Component.processMouseEvent(Unknown Source)
	at java.desktop/javax.swing.JComponent.processMouseEvent(Unknown Source)
	at java.desktop/java.awt.Component.processEvent(Unknown Source)
	at java.desktop/java.awt.Container.processEvent(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)

Ignition v8.1.7 (b2021060314)
Java: Azul Systems, Inc. 11.0.11

```

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [April 24, 2023, 5:07pm UTC](https://forum.inductiveautomation.com/t/java-lang-error-on-actionperformed-button/72827/5 "2023-04-24T17:07:39Z")

</div>

You have defined productionreq inside the scope of an `if` statement and then tried to use it outside of that scope.

I suspect that you will have the same issue with safetyreq, engineeringreq, and qualitynote.

Also, you should be using boolean built-ins instead of 1 or 0.

So this:

```auto
#conditions requiring production approval
if sop == 1 or recipe == 1 or parameter == 1 or physical == 1 or chem == 1 or automation == 1 or ocSafe == 1 or safetyBypass == 1:
	productionreq = 1
else:
	productionreq = 0

```

Should really be this:

```auto
productionreq = sop or recipe or parameter or physical or chem or automation or ocSafe or safetyBypass

```

The better, more pythonic way to write that is using the any() function.

```auto
productionreq = any((sop,recipe,parameter,physical,chem,automation,ocSafe,safetBypass))

```

---

<div class="post-metadata">

**Author:** ![Ashlea\_Brown](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@Ashlea\_Brown](https://forum.inductiveautomation.com/u/Ashlea_Brown)\
**Post date:** [April 24, 2023, 5:16pm UTC](https://forum.inductiveautomation.com/t/java-lang-error-on-actionperformed-button/72827/6 "2023-04-24T17:16:37Z")

</div>

> [@lrose](#):
>
> ```auto
> if sop == 1 or recipe == 1 or parameter == 1 or physical == 1 or chem == 1 or automation == 1 or ocSafe == 1 or safetyBypass == 1:
> productionreq = 1
> else:
> productionreq = 0
> 
> ```

I have made these changes and I still get the error that production req is not defined.

```auto
# This script was generated automatically by the update query
# script builder. You may modify this script, but if you do,
# you will not be able to use the update query builder to update
# this script without overwriting your changes.

#ID of request pulled from change request text field. That field is autopopulated with the next highest available ID number
id = event.source.parent.getComponent('Change Request ID Text Field').intValue

#request date pulls current time on server
reqDate = system.date.now()

#impDate set by user
impDate = event.source.parent.getComponent('Date Implemented Cal').date

#user selected temporary change
temp = event.source.parent.getComponent('Temp Change CheckBox').selected

#if change is temporary use user selected data. if not temporary, value null
if temp == 1:
	revDate = event.source.parent.getComponent('Date Reverted Cal').date
else:
	revDate = None

#set initial status to implemented unless already reverted temporary change
if temp == 1 and revDate < reqDate:
	status = "Reverted"
else: 
	status = "Implemented"

#initiator autofills with active user but can be changed - text field
initiator = event.source.parent.getComponent('Initiator Text Field').text

#department will determine who approves/gets notified - dropdown
department = event.source.parent.getComponent('Department Dropdown').selectedLabel

#available areas determined by department selection - dropdown
area = event.source.parent.getComponent('Area Dropdown').selectedLabel

#description of the change made - text area
description = event.source.parent.getComponent('Description Text Area').text

#justification for change being made - text area
justification = event.source.parent.getComponent('Justification Text Area').text

#SOP change? -checkbox
sop = event.source.parent.getComponent('SOP CheckBox').selected

#recipe/raw material change - checkbox
recipe = event.source.parent.getComponent('Recipe CheckBox').selected

#process parameter change - checkbox
parameter = event.source.parent.getComponent('Parameter Checkbox').selected

#physical equipment mod - checkbox
physical = event.source.parent.getComponent('Equipment Checkbox').selected

#change impacting occupational safety - checkbox
ocSafe = event.source.parent.getComponent('OcSafety Checkbox').selected

#change to chemical type or handling - checkbox
chem = event.source.parent.getComponent('Chemical Check Box').selected

#programming change/HMI change/sensor change - checkbox
automation = event.source.parent.getComponent('Automation Checkbox').selected

#does the change bypass a safety function/protocol - checkbox
safetyBypass = event.source.parent.getComponent('Safety Bypass Checkbox').selected

system.nav.closeParentWindow(event)

##conditions requiring production approval
#if sop == 1 or recipe == 1 or parameter == 1 or physical == 1 or chem == 1 or automation == 1 or ocSafe == 1 or safetyBypass == 1:
#	productionreq = 1
#else:
#	productionreq = 0

productionreq = sop or recipe or parameter or physical or chem or automation or ocSafe or safetyBypass

##conditions requiring safety approval
#if chem == 1 or ocSafe == 1 or safetyBypass == 1:
#	safetyreq = 1
#else: safetyreq = 0

safetyreq = chem or ocSafe or safetyBypass

##conditions requiring engineering approval
#if recipe == 1 or parameter == 1 or physical == 1 or chem == 1 or automation == 1 or safetyBypass == 1:
#	engineeringreq = 1
#else:
#	engineeringreq = 0

engineeringreq = recipe or parameter or physical or chem or automation or safetyBypass

#conditions requiring quality notification
#if recipe == 1:
#	qualitynote = 1
#else:
#	qualitynote = 0
	
qualitynote = recipe

#conditions requiring maintenance notification
maintenancenote = 1

#prodApprover = "test"
#prodDate = system.date.now()
#engrApprover = "test"
#engrDate = system.date.now()
#safeApprover = "test"
#safeDate = system.date.now()
#finalApproval = 0
#finalDate = system.date.now()

system.db.runNamedQuery("UpdateChangeRequest", {"RequestStatus":status, "DateImplemented":impDate, "Temporary":temp, "DateReverted":revDate, "Initiator":initiator, 
"Department":department, "Area":area, "Description":description, "Justification":justification, "SOP":sop , "Recipe":recipe, "Parameter":parameter, "Physical":physical,
"OcSafety":ocSafe,"SafetyBypass":safetyBypass,"Chemical":chem ,"Automation":automation, "ReqProduction":productionreq, "ApproverProd":prodApprover,"ApproverProdDate":prodDate,"ApproverEngr":engrApprover,
"ApproverEngrDate":engrDate,"ApproverSafe":safeApprover,"ApproverSafeDate":safeDate,"ApprovalFinal":finalApproval, "DateApproved":finalDate, "ReqProduction":productionreq, "ChangeReq":id})

##creates email address of initiator
initiatorEmail = initiator + "@stonebrewing.com"

##sets up list for the notification report to go out to
distribution = [initiatorEmail]

#adds production notification to the list dependent on what department was selected
if productionreq == 1 and department == "Brewing":
	distribution.append("nicole.williams@stonebrewing.com")
elif productionreq == 1 and department == "Packaging":
	distribution.append("nicole.williams@stonebrewing.com")
elif productionreq == 1 and department == "Water Rec":
	distribution.append("nicole.williams@stonebrewing.com")	
elif productionreq == 1 and department == "Escondido Production":
	distribution.append("nicole.williams@stonebrewing.com")

#adds other relevant notifications to the distribution list				
if engineeringreq == 1:
	distribution.append("nicole.williams@stonebrewing.com")
if safetyreq == 1:
	distribution.append("nicole.williams@stonebrewing.com")	
if qualitynote == 1:
	distribution.append("nicole.williams@stonebrewing.com")	
if maintenancenote == 1:
	distribution.append("nicole.williams@stonebrewing.com")
	
#establishes email contents
emailSubject = "Change Notification #" + str(id)
emailBody = "User: " + initiator + " <br/> " + "Department: " + department + " <br/> " + "Area: " + area + " <br/> " + "Description: " + description
emailSettings = {"to":distribution, "smtpServerName":"StoneEmail", "from":"ignition_alerts@stonebrewing.com", "subject":emailSubject, "body":emailBody}

#emails out the report
reportParameters = {"changeid":str(id),"initiator":initiator,"date":impDate,"temporary":temp,"department":department,"area":area,"description":description,"justification":justification,
"sop":sop,"recipe":recipe,"parameter":parameter,"physical":physical,"ocsafety":ocSafe,"chemicals":chem,"automation":automation,"safetybypass":safetyBypass}
system.report.executeAndDistribute(path="Change Notification", project="HMI", parameters = reportParameters, action= "email", 
  actionSettings = emailSettings)

#system.db.refresh(event.source.parent.getComponent('Power Table'),"data")

```

Also, the original script has it written that way and works fine. I am not sure what the difference is here.

Here is the error

```auto
Traceback (most recent call last):
  File "<event:actionPerformed>", line 120, in <module>
NameError: name 'productionreq' is not defined

	at org.python.core.Py.NameError(Py.java:290)
	at org.python.core.PyFrame.getname(PyFrame.java:257)
	at org.python.pycode._pyx16.f$0(<event:actionPerformed>:147)
	at org.python.pycode._pyx16.call_function(<event:actionPerformed>)
	at org.python.core.PyTableCode.call(PyTableCode.java:171)
	at org.python.core.PyCode.call(PyCode.java:18)
	at org.python.core.Py.runCode(Py.java:1614)
	at com.inductiveautomation.ignition.common.script.ScriptManager.runCode(ScriptManager.java:799)
	at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.runActions(ActionAdapter.java:206)
	at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.invoke(ActionAdapter.java:297)
	at com.inductiveautomation.factorypmi.application.binding.action.RelayInvocationHandler.invoke(RelayInvocationHandler.java:57)
	at com.sun.proxy.$Proxy45.actionPerformed(Unknown Source)
	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
	at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
	at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
	at java.desktop/javax.swing.DefaultButtonModel.setPressed(Unknown Source)
	at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
	at java.desktop/java.awt.Component.processMouseEvent(Unknown Source)
	at java.desktop/javax.swing.JComponent.processMouseEvent(Unknown Source)
	at java.desktop/java.awt.Component.processEvent(Unknown Source)
	at java.desktop/java.awt.Container.processEvent(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)

Ignition v8.1.7 (b2021060314)
Java: Azul Systems, Inc. 11.0.11

```

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [April 24, 2023, 5:25pm UTC](https://forum.inductiveautomation.com/t/java-lang-error-on-actionperformed-button/72827/7 "2023-04-24T17:25:11Z")

</div>

The only other thing I see is that ReqProduction is defined twice in the parameters dictionary in the call to runNamedQuery().

When I pasted this into the script console line 120 is a comment. What line is line 120?

---

<div class="post-metadata">

**Author:** ![Ashlea\_Brown](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@Ashlea\_Brown](https://forum.inductiveautomation.com/u/Ashlea_Brown)\
**Post date:** [April 24, 2023, 5:27pm UTC](https://forum.inductiveautomation.com/t/java-lang-error-on-actionperformed-button/72827/8 "2023-04-24T17:27:50Z")

</div>

![Capture](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/8/b8ebb6dcbcb773026a286e25669117d9cb140281.png)

It is a comment

---

<div class="post-metadata">

**Author:** ![Ashlea\_Brown](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@Ashlea\_Brown](https://forum.inductiveautomation.com/u/Ashlea_Brown)\
**Post date:** [April 24, 2023, 5:28pm UTC](https://forum.inductiveautomation.com/t/java-lang-error-on-actionperformed-button/72827/9 "2023-04-24T17:28:23Z")

</div>

I went ahead and deleted the extra defined parameter. Error still occuring

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [April 24, 2023, 6:42pm UTC](https://forum.inductiveautomation.com/t/java-lang-error-on-actionperformed-button/72827/10 "2023-04-24T18:42:54Z")

</div>

At line 69:

```python
system.nav.closeParentWindow(event)

```

Try commenting that out. It should really be at the end, anyway.

Also, throw in a few `print productionreq` lines in there. Ensure it is getting initialized and that no other oddities are happening.
