Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Disabling subgrid in Dynamics CRM CE

(0) ShareShare
ReportReport
Posted on by 115

Still looking a script to disabling subgrid in Dynamics CRM CE. Previously , i wokring for Dynamics CRM v8.2 and using this unsupported javascript to disabling subgrid. So the users unable to double click the subgrid. 

document.getElementById(subgridName   "_span").disabled = "true";

But its seem that those script cannot run on Dynamics CRM CE with editable subgrid. ive been looking in this forum, but still not found the solution.  Is there anybody able to accomplish this ?

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Disabling subgrid in Dynamics CRM CE

    Hi FikriHailal,

    You can disable subgrid view through disabling editing of all fields.

    function onrowselect(executionContext) {
        var entityObject = executionContext.getFormContext().data.entity;
        entityObject.attributes.forEach(function (attribute, i) {
                var emailControl = attribute.controls.get(0);
                emailControl.setDisabled(true);        
        });
    }

    You can refer following link for more details:

    Dynamics 365 editable sub-grid fields are disabled and not editable - Programmer Sought

    Regards,

    Leah Ju

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

  • Suggested answer
    meelamri Profile Picture
    meelamri 13,206 User Group Leader on at
    RE: Disabling subgrid in Dynamics CRM CE

    Hi, 

    If I understand your need correctly, you want to disable the editing of records that are in your subgrid. To do this you can disable the control on each cell of your grid. The GridCell object has the method setDisabled which will allow you to disable the control.

    Please refer to the documentation: docs.microsoft.com/.../gridcell

  • FikriHailal Profile Picture
    FikriHailal 115 on at
    RE: Disabling subgrid in Dynamics CRM CE

    Hi, im affraid i can't do that. Basically this subgrid enable for all user. But when the record status change from draft to submit. Subgrid became disable. I need to control the subgrid through javascript.

  • Suggested answer
    Naveen Ganeshe Profile Picture
    Naveen Ganeshe 3,393 User Group Leader on at
    RE: Disabling subgrid in Dynamics CRM CE

    Hello,

    I believe you can assign read privileges to that entity for specific users.

    or

    Please take a look at this link: stackoverflow.com/.../cant-disable-field-subgrid-with-javascript

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,711 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans