Hi,
I am just wondering, how is it possible to make a record read only based on a field value in the record? Is it a Field Security setting or a User permissions setting?
Basically, I have created a new Custom entity for a database I have built of staff. I have created one field which has 3 values that can be selected in a traffic light type system. So the values are Green, Orange and Red.
I would like to make the record read-only if the values in the field are either Red or Amber.
Thanks a lot as always
Ted
If you do this JavaScript approach, make sure to do OnLoad as well, or else they could potentially come back into the record and the field be unlocked.
Hi Ted,
This should be easily achievable using a simple script on that form.
The flow should be:
- create the javascript file and register it on the form
- register the function on the OnChange event of the field with Green, Orange and Red values (when it changes, run the script)
- in the script, check if the value is "Red" for example
- if yes, set another field on the form as Read Only
How to get the value of a field on a form: docs.microsoft.com/.../getvalue
And with this function, you can set the field as read only (disabled): docs.microsoft.com/.../setdisabled
Hope this helps!
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,151 Super User 2024 Season 2
Martin Dráb 229,963 Most Valuable Professional
nmaenpaa 101,156