Feeling Dumb With a Numeric Text Field

#1

So to get it out of the way, I am running 7.8.5. The simple answer may be no, but I am trying to store the old value from a text field in a custom property when a new value is entered. I’m doing this through a propertychange script:

value = event.source.value.oldValue

event.source.OldVal = value

However, this is causing me to get the error:
image

Does the numeric text field not have an oldValue attribute, or do I just completely have my code messed up?

0 Likes

#2

Is that the extent of your code in the propertyChange event? If so, then you need to filter it down to just property changes on the text property; something like:

if event.propertyName == "text":
    event.source.OldVal = event.oldValue
0 Likes

#3

You nailed it on the head! In hindsight that completely makes sense that it wouldn’t know which value changed unless I specifically told it. Revised code is:

if event.propertyName == "floatValue":
    event.source.OldVal = event.oldValue
1 Like