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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

How to make the default view as read only for an entity so no user can edit the field in that view.

(2) ShareShare
ReportReport
Posted on by 10
Thanks in Advance, Can anyone help me on how to make the default public view of an entity as read only or restrict the user to edit any column in that view. If I select any record all the column are shown as locked except the highlighted columns. Is there a way to  lock the those columns in the view or to make the whole view as read only.
 
I have the same question (0)
  • Suggested answer
    Holly Huffman Profile Picture
    6,534 Super User 2025 Season 2 on at
    Hi there! Good morning, evening, or afternoon - depending on where you are :) Hope you are well today! 
     
    To make the default view of an entity read-only in Dynamics 365, you can achieve this by leveraging field-level security or custom JavaScript. Here's how you can approach this:
    1. Field-Level Security
    • Use field-level security to restrict editing of specific fields in the entity:
      • Navigate to Settings > Security > Field Security Profiles.
      • Create a new profile or edit an existing one.
      • Add the fields you want to lock and set their permissions to Read-only for the relevant users or teams.
    • This ensures that users can view the fields but cannot edit them, even in the default view.
     
    2. Custom JavaScript
    • Add JavaScript to the entity form to dynamically lock fields based on the view:
      • Navigate to Settings > Customizations > Customize the System.
      • Open the entity form and add a JavaScript web resource.
      • Use the following code snippet to lock fields:
        function lockFields(executionContext) {
            var formContext = executionContext.getFormContext();
            var fieldsToLock = ["field1", "field2"]; // Replace with actual field names

        fieldsToLock.forEach(function(field) {
                var attribute = formContext.getAttribute(field);
                if (attribute) {
                    attribute.controls.forEach(function(control) {
                        control.setDisabled(true);
                    });
                }
            });
        }
      • Register the script on the form's OnLoad event.
    3. Use a Custom View
    • Create a custom view that displays the required fields but restricts editing:
      • Navigate to Settings > Customizations > Views.
      • Create or edit the default view for the entity.
      • Configure the view to display only the fields you want users to see.
    • While this doesn't lock the fields, it limits what users can interact with.
     
    4. Role-Based Security
    • Use role-based security to restrict editing permissions for the entity:
      • Navigate to Settings > Security > Security Roles.
      • Edit the relevant role and set the entity's permissions to Read-only.
    5. Test the Configuration
    • After implementing the changes, test the default view to ensure that the fields are locked and users cannot edit them.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 503 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 434 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 278 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans