Customer Engagement & Dynamics CRM Forum

Expand all | Collapse all

Disable Subgrid on Form

  • 1.  Disable Subgrid on Form

    Posted Oct 21, 2018 12:50 PM
    I have an Order form that contains a subgrid of Order Products in one Section of the form.

    When an Order has been successfully sent for processing, I want to disable all fields on the Order form so the user cannot make any changes.

    I have successfully disabled all fields using javascript to disable all tabs and all sections on the form, but it does not work for the Order Products subgrid. The user still has the ability to double click on a row in the subgrid and open the Order Products form for editing. I could modify the Order Products form to disallow edits, but if possible, I'd like to disable the Order Products subgrid on the Order form so that the user cannot even open the Order Products form for a given line.

    Suggestions?

    ------------------------------
    Laura Longley
    Dominic Systems Limited
    Chilliwack BC
    ------------------------------


  • 2.  RE: Disable Subgrid on Form

    TOP CONTRIBUTOR
    Posted Oct 22, 2018 04:26 AM
    Even if these records were all read-only, you'd still be able to open the subgrid and view the records. Any changes to the subgrid to make it completely non-interactive would be unsupported I would think. I would suggest the best way forward is to make the order products form read-ony via the same method.

    Also, is there a reason you can't use one of the out-of-the-box statuses to lock the record down? If I recall, setting an order to "submitted" means it can't be edited anymore.

    ------------------------------
    Tom Pickles
    Dynamics CRM Analyst
    ICAS
    EDINBURGH
    ------------------------------



  • 3.  RE: Disable Subgrid on Form

    TOP CONTRIBUTOR
    Posted Oct 22, 2018 01:49 PM
    ​Laura,

    It can be done in a supported way, but even then, it is not a perfect solution.  In our case we set a two-option field on the form called DatagridReadOnly and then altered the visibility of the Add and Delete buttons for that entity based on the content of that checkbox.  I think there is some javascript code as well, but it has been a while and someone else on my team created this solution.

    If you'd like more details on this approach, please let me know and I'll get the information together.

    Thanks,
    Glen


    ------------------------------
    Glen Wolinsky
    Lead Applications Developer
    Miller & Martin PLLC
    Chattanooga TN
    ------------------------------



  • 4.  RE: Disable Subgrid on Form

    TOP CONTRIBUTOR
    Posted Dec 14, 2020 10:55 AM
    Glen,

    I know this thread is a little old, but do you know if there have been any changes to D365 that would allow a subgrid to be set read only?  Would i still need to hide the Add and Delete buttons, if so, can that be done with javascript?

    Any help is appreciated,

    ------------------------------
    Jim Corriveau
    A.W. Chesterton Company
    Groveland MA
    ------------------------------



  • 5.  RE: Disable Subgrid on Form

    TOP CONTRIBUTOR
    Posted Dec 17, 2020 10:37 AM

    Has anyone been able to disable/lock a subgrid using javascript on page load?

    I've found examples but they date back a few years and do not seem to work now.

    Thank you,



    ------------------------------
    Jim Corriveau
    A.W. Chesterton Company
    Groveland MA
    ------------------------------



  • 6.  RE: Disable Subgrid on Form

    TOP CONTRIBUTOR
    Posted Dec 22, 2020 01:14 PM

    Hope everyone is well.

    If a subgrid cannot be set read-only on a page, is there another control that can be used to show related records in an N:N relationship that can be set read only?

    Enjoy the holidays,



    ------------------------------
    Jim Corriveau
    A.W. Chesterton Company
    Groveland MA
    ------------------------------



  • 7.  RE: Disable Subgrid on Form

    TOP CONTRIBUTOR
    Posted Dec 29, 2020 08:56 AM

    Jim,

    Sorry for the delay. Not to my knowledge. It seems MS is not interested in doing some of these obvious things.  If anyone else out there knows another way, I would certainly be interested.

    Thanks,
    Glen



    ------------------------------
    Glen Wolinsky
    Lead Applications Developer
    Miller & Martin PLLC
    Chattanooga GA
    ------------------------------



  • 8.  RE: Disable Subgrid on Form

    TOP CONTRIBUTOR
    Posted Mar 03, 2021 07:35 AM
    In the sub grid there is a control for "Read Only Grid", but it seem like it does not work.  Has anyone figured out a way to make a subgrid read only, or is there a way to show a list of related records in a read only grid?


    Thank you,

    ------------------------------
    Jim Corriveau
    A.W. Chesterton Company
    Groveland MA
    ------------------------------



  • 9.  RE: Disable Subgrid on Form

    TOP CONTRIBUTOR
    Posted 28 days ago
    Does anyone know if sub grids can be made read only in 2021 Wave 1?

    Thank you,

    ------------------------------
    Jim Corriveau
    A.W. Chesterton Company
    Groveland MA
    ------------------------------



If you've found this thread useful, dive deeper into User Group community content by role