Hello everyone,
I’m currently experiencing an unexplained issue with an Edit Change Script on the Parameter PassedOnOrderID.
Whenever a value is being passed on to the PassedOnOrderID Parameter the following Script is executed:
# Retrieve the passed ID or order number
passedOnID = self.params.PassedOnOrderID
system.perspective.print('passedOnID is: ' + str(passedOnID))
# Get a reference to the table component
table = self.getChild("root").getChild("fc_Offline_Programmieraufträge").getChild("Table_Orders") # Adjust path to table
system.perspective.print('Table is: ' + str(table))
# Retrieve the data of the table
tableData = table.props.data # Data must be fully loaded
system.perspective.print('tableData is: ' + str(tableData))
# Find the row index that corresponds to the passed ID or order number
rowIndex = next((index for index, row in enumerate(tableData) if str(row["ID"]) == str(passedOnID)), None)
system.perspective.print('rowIndex is: ' + str(rowIndex))
# If a valid row index is found, open the subview
if rowIndex is not None:
table.expandSubviews([rowIndex]) # Open the subview of the corresponding row
else:
system.perspective.print("No row index found matching the passed OrderID.")
This script has been working successfully across multiple projects. However, for some reason, an issue arises when trying to assign the table component to the variable table . I consistently encounter the following error:
AttributeError("'NoneType' object has no attribute 'getChild'",)
Interestingly, this works without any problems:
table = self.getChild("root").getChild("fc_Offline_Programmieraufträge")
But as soon as I try to directly reference the table, like this:
table = self.getChild("root").getChild("fc_Offline_Programmieraufträge").getChild("Table_Orders")
I get the error.
What I’ve checked so far:
Table Path : The path seems correct since the parent node is found without issues. I’ve also verified that the table exists in the Designer and is correctly named.
Does anyone have any idea what could be causing this or how I can debug the issue further?
Thanks in advance for your help!