Getting "object has no attribute" error in Msg Hdlr for custom property on View Root

Hi have a Message Handler on the root of a Perspective view.
In the script I am assigning a varialbe to the value contained in a
When this script runs I get the following error:

com.inductiveautomation.ignition.common.script.JythonExecException: Traceback (most recent call last): File "", line 11, in onMessageReceived AttributeError: 'com.inductiveautomation.perspective.gateway.script' object has no attribute 'workOrderQuantity'
at org.python.core.Py.AttributeError(
at org.python.core.PyObject.noAttributeError(
at org.python.core.PyObject.__getattr__(
at org.python.pycode._pyx187.onMessageReceived$1(:12)
at org.python.pycode._pyx187.call_function()
at org.python.core.PyFunction.function___call__(
at org.python.core.PyFunction.__call__(
at org.python.core.PyFunction.__call__(
at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(
at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(
at com.inductiveautomation.ignition.gateway.project.ProjectScriptLifecycle$TrackingProjectScriptManager.runFunction(
at com.inductiveautomation.ignition.common.script.ScriptManager$ScriptFunctionImpl.invoke(
at com.inductiveautomation.ignition.gateway.project.ProjectScriptLifecycle$AutoRecompilingScriptFunction.invoke(
at com.inductiveautomation.perspective.gateway.script.ScriptFunctionHelper.invoke(
at com.inductiveautomation.perspective.gateway.model.MessageHandlerCollection$MessageHandlerImpl$1.lambda$invoke$0(
at java.base/java.util.concurrent.Executors$ Source)
at java.base/ Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$ Source)
at java.base/ Source)
Caused by: org.python.core.PyException: Traceback (most recent call last): File "", line 11, in onMessageReceived AttributeError: 'com.inductiveautomation.perspective.gateway.script' object has no attribute 'workOrderQuantity'

The Custom Property is shown in the screen grab below:

The script is as follows:

	qty = self.custom.workOrderQuantity
	self.view.params.qtyOrdered = qty

Note: I set the qty variable = to the custom property to isolate it from the line setting the view’s parameter.
As I used the Property Browser in the script editor for the message handler, I know the spelling and path to the property are both correct.

Any ideas why I’m getting this error?
The error also generates after I’ve saved the view, closed the project, and re-open the project and view (the message handler is called by an onStartup script in the view to refresh the data bindings in the view).


.refreshBinding() is not synchronous. You’ve told custom.workOrderQuantity to refresh and then you immediately reference its value. Can’t count on that. You’ll need a propertyChange action on the property to know the value is available. Or a binding.

Thanks Phil.
I had not even considered that.
There is so much to know about Ignition and I have very limited free gray matter! :upside_down_face:

Hmm, refreshBinding looks like it’s attempting to be synchronous…

@MikeAllgood, before you attempt to assign, can you try adding:


You are calling these in the root or the component above the root?

The refresh Message Handler script, that this script is in, is on the root of the view. The refreshBinding functions are working properly. It’s the use of self.custom.workOrderQuantity that is throwing the error.

I’m not sure anyone answered the actual question. The bindings are may be out of date as pointed out, but the object should still exist, which is the error.
I was having the same issue and I am not doing any refreshing. Things were working fine in the designer but I was getting an error stating that a custom property did not exist when running a session. When I closed the designer and reopened it, I found I did have the same error.
I found was there were custom properties that were disappearing from the object, but not the one that I was getting the error for. When I added the two missing parameters back, their bindings would also magically reappear. This was repeatable, close the designer, reopen and they are gone. What I found was that I had changed the name of an object that was used in the bindings for those two parameters and not fixed the bindings. Once I fixed that, all was well. I have no idea why it was giving an error for a parameter that was not actually disappearing or why the system would be programmed to make parameters invisible if they had a problem with the binding.