Before I start, I did not write any of this code -- I just need to understand it so I can fix some stuff.
We're seeing some bugs that all seem related to a right click menu on a Power Table. I'm scratching my head because within the "onPopupTrigger" event script for the Power Table (which is called when a user right clicks on a table cell), there are several functions defined and then called as arguments by doing a simple one of these:
menu = system.gui.createPopupMenu({'Delete entry':DeleteEntry,'Review Entry':Review, ... ... })
menu.show(event)
The weird thing is, one of these functions that is causing an error is just not defined in here, and I can't find where it is defined, yet it still exists somewhere in the project... (The error is basically just a dialog box that is opening at unexpected times -- so I am tracking down that popup box line of code).
But anyway, it's almost like there are rows in here that I'm just not seeing. "Ghost rows" of code or something. The code below is exactly how the script looks in the onPopupTrigger event (with certain names changed). This is including the over-indentation in the beginning (there is a red squiggly line underneath the def Review line, like Ignition does not like these indents yet everything still works here) and not-yet-defined "DQ" string being thrown into system.db.runPrepUpdate on the third line. It's like the script starts right in the middle of where my "DeleteEntry" definition would be. I hope I explained this properly... When I do a Ctrl + F to try to find this missing definition, nothing comes up, so I keep going in circles trying to find it.
def onPopupTrigger(self, rowIndex, colIndex, colName, value, event):
DA = [ID]
system.db.runPrepUpdate(DQ,DA,'MY_DATABASE')
DNQ = """DELETE FROM MY_TABLE WHERE ID = ? """
DNQA = [ID]
system.db.runPrepUpdate(DNQ,DNQA,'MY_DATABASE')
system.db.refresh(self, "data")
def Review(REntry):
if system.gui.confirm("Are you sure you would like to request a review of this entry?", "Entry Review?"):
Recipient = ["recipient1@company.com","recipient2@company.com"]
...
...
I realize this looks really messy and probably doesn't have enough info for anyone here to fully understand what could be going on. Just hoping for a starting point maybe.