So I have code which executes once someone fills out a text input. It automatically invisibly runs the import button for my table, pulls and writes data. This was working fine. After some adjustments when I fill out the text input it now transfers me to my table window, which it didn’t do before. I will show both code below.
WORKING CODE:
BUTTON
import csv
#Monday Import
file = open("\\\\LOCALv\\datasource$\\LOCALTION\\Monday_WFData.csv")
csvData = csv.reader(file)
header = csvData.next()
pyData = []
for row in csvData:
pyData.append(row)
finalData = system.dataset.toDataSet(header,pyData)
event.source.parent.getComponent('Monday Table').data = finalData
INPUT
value = event.source.parent.getComponent('WF Input').text
system.tag.writeToTag('System1/Efficiency/Line_6/WF_Num', value)
system.nav.openWindow("Main Windows/Table Import")
window = system.gui.getWindow("Main Windows/Table Import")
data = window.rootContainer.getComponent("Monday Table").data
system.nav.closeWindow("Main Windows/Table Import")
WF = value
for row in range(data.rowCount):
index_row = data.getValueAt(row, 0)
if index_row == WF:
prod_nam = data.getValueAt(row, 1)
bot_size = data.getValueAt(row, 2)
allergen = data.getValueAt(row, 7)
system.tag.writeToTag('System1/Efficiency/Line_6/Product_Name', prod_nam)
system.tag.writeToTag('System1/Efficiency/Line_6/Bottle Size', bot_size)
system.tag.writeToTag('System1/Efficiency/Line_6/ALLERGEN', allergen)
NON WORKING CODE
BUTTON
import csv
#Item Master Import
file = open("\\\\LOCALv\\datasource$\\LOCALData\\Item_Master.csv")
csvData = csv.reader(file)
header = csvData.next()
pyData = []
for row in csvData:
pyData.append(row)
finalData = system.dataset.toDataSet(header,pyData)
event.source.parent.getComponent('Item Master').data = finalData
INPUT
value = event.source.parent.getComponent('WF Input').text
system.tag.writeToTag('System1/Efficiency/Line_6/WF_Num', value)
system.nav.openWindow("Main Windows/Table Import")
window = system.gui.getWindow("Main Windows/Table Import")
data = window.rootContainer.getComponent("andrews table").data
system.nav.closeWindow("Main Windows/Table Import")
WF = value
for row in range(data.rowCount):
index_row = data.getValueAt(row, 0)
if index_row == WF:
prod_nam = data.getValueAt(row, 1)
bot_size = data.getValueAt(row, 2)
allergen = data.getValueAt(row, 4)
system.tag.writeToTag('System1/Efficiency/Line_6/Product_Name', prod_nam)
system.tag.writeToTag('System1/Efficiency/Line_6/Bottle Size', bot_size)
system.tag.writeToTag('System1/Efficiency/Line_6/ALLERGEN', allergen)
Thank you in advance for helping