I have a user event script set to “Run As Administrator” targeting a custom record type.
One of the fields on the custom record is restricted to admin only. However users can still create new records and edit all the other fields
In BeforeSubmit, it queries the last submitted record, and takes the value of that ‘locked down’ field, and calls setValue() on the new record. The idea is to copy the restricted value over to the new record even though the user doesn’t have permission to see that field.
It works fine when I create the record as an admin, but when I run it in a different role the setValue doesn’t appear to work. I even logged the value to confirm that the “run as administrator” script is capable of reading it in this context.
Is that expected behavior?