I have created a script that works to change the colour of the record conditionally. I initially created it as a form script and can run it or use a shortcut and it does what it is supposed to do. I tried the same script on a field because I want it to activate automatically as soon as a new record is added or an existing one changed. Although the script works when I run it manually on the field it does not automatically activate when the reference field is modified.
The first line of code (var type_id = record.getFieldValue (‘fld-631813d9eff54787894020691031bc77’);) references the field and gets the data successfully.
Any suggestions?
So you’re changing the value of your fld-631813d9eff54787894020691031bc77
field? That should trigger the script to run. Put in a console log to see if that solves the problem. Also don’t forget to call form.saveAllChanges()
to commit the change to the database. That generally triggers a refresh of the display.