web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

Making a Record read-only based on a field value

(0) ShareShare
ReportReport
Posted on by 479

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

I have the same question (0)
  • Suggested answer
    Stefan Cojocaru Profile Picture
    on at
    RE: Making a Record read-only based on a field value

    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!

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: Making a Record read-only based on a field value

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
#ManoVerse Profile Picture

#ManoVerse 101

#2
Siv Sagar Profile Picture

Siv Sagar 93 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 66 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans