Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Level 8

ifSGNodeField.setField() fail

I have a situation where setting a field on a node occasionally fails. According to the documentation:


setField(fieldName as String, value as Object) as Boolean

Sets the value of the subject node field identified by fieldName to value. This will fail and stop script execution if the value is not of the appropriate type. Returns true if the field is successfully set, false otherwise.




So, setField() is definitely returning false, and the field type is definitely correct (it's defined as a string, and I'm definitely attempting to set a string on it). Is there anything else that could make setting a value on a field fail besides a type mismatch?
0 Kudos
3 Replies
Highlighted
Level 10

Re: ifSGNodeField.setField() fail

Are you sure it is returning False?
From what i remember, setField() was "silent but deadly", contrary to what TFM says - i.e. it was neither stopping with error nor returning false when called with wrong arguments.
0 Kudos
Highlighted
Level 8

Re: ifSGNodeField.setField() fail

The code I used to test this is:


isFieldSet = m.top.setField("someField", someString)
print "isFieldSet: "; isFieldSet


And I see in the console:

isFieldSet: false



So, I'm as sure as I can be.
0 Kudos
Highlighted
Level 10

Re: ifSGNodeField.setField() fail

"brybott" wrote:
So, I'm as sure as I can be.

Splendid. Now give a more complete example, so one can reproduce the issue. I.e. what type is the field, where is it declared, what's assigned and so on.
0 Kudos