self.props.something in a transform is a ‘side effect’, and not generally using transform the way they’re “meant” to be used. The recommended way to use any transform, including scripting, is to mutate the incoming value and transform it into something else. In a script transform, the correct way to do that is via the
return statement; the entire script transform is modeled as a function, that accepts the value of the previous step of the binding, then returns the modified value.
Writing to other properties is possible, as you noticed; setting
self.props.tex to some value is going to create a new property, because you’re telling the component "here’s a new value for
props.tex". However, it shouldn’t be necessary in 90% of cases, and should be avoided. Think about the maintenance problem; in six months, or a year or two, if you come back to this screen, are you going to expect the
enabled property to be toggled by a script “hidden” in the
self.props.text binding? Instead, you should write your transform as follows, then add a second binding on a
self.props.enabled that checks whether
ds = system.db.runNamedQuery("SELECT2CUSTOMERS")
for row in range(ds.rowCount):
if ds.getValueAt(row, "DETAIL_CODE") == value:
return "UNIQUE CODE"