I have a custom function on a component called refreshData. Inside this function I have a call to [tt]system.util.invokeAsynchronous[/tt] and it was giving me the error that it couldn’t find the attribute [tt]invokeAsynchronous[/tt]. I tried it with [tt]invokeLater[/tt] as well and it had the same issue. I added a simple call to [tt]system.db.runQuery(“Select 4”)[/tt] and this time instead of erroring on [tt]runQuery[/tt] it errored on [tt]db[/tt] with a similar message:
Traceback (most recent call last):
File "<event:visionWindowOpened>", line 5, in <module>
File "<custom-function refreshData>", line 4, in refreshData
AttributeError: 'com.inductiveautomation.ignition.common.script.Scr' object has no attribute 'db'
This code is being called from inside [tt]visionWindowOpened[/tt], if that makes any difference. I even tried calling the function with [tt]invokeLater[/tt] from within the [tt]visionWindowOpened[/tt] event thinking maybe there was an issue with system.* not having fully loaded yet or something odd like that, but that made no difference.