Skip to main content

Notifications

Dynamics 365 general forum

how to make a sub grid read only

Posted on by 150

having two entity activity & expense . activity has a Sub grid of expense . user claiming expense should be within three days of activity created. if its is greater than three days of activity created the expense grid should be in read only state . r else should i make the expense form filed read only  ? 

  • LeoAlt Profile Picture
    LeoAlt 16,329 on at
    RE: how to make a sub grid read only

    Hi partner,

    We could make subgrids read-only in two ways and here are some samples for you to refer to. You could set up the trigger condition and then disable the subgrid.

    1.Use JS code to make subgrids disabled.

    community.dynamics.com/.../236280

    2.Hide "+" button of subgrid.

    https://community.dynamics.com/crm/f/117/t/244901

    Hope it helps.

    Best Regards,

    Leo

  • Suggested answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: how to make a sub grid read only

    Hi ,

    Can you please specify what is your actual requirement ,  making read only subgrid  entity record or create subgrid entity record ?

    To make update  form read only for me you can simply create field and the based on field value  disable the fields in the forms . Create business rules for that .

    If you want to restrict creation then implement workflow and validate the parent field value.

    goutamdascrm.wordpress.com/.../validate-different-entity-fields-value-using-workflow

  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: how to make a sub grid read only

    Hi,

    I've changed the link.

    https://www.inogic.com/blog/2017/01/hide-add-button-on-a-subgrid-by-applying-custom-javascript-rule/

    If your requirement is to stop user to edit the expense form. even you make the expense form field read only, user can still easily hack through excel import( if they know how to ) . So use workflow or plugin, throw some meaningful error message to user if the condition is met.

  • thuya Profile Picture
    thuya 150 on at
    RE: how to make a sub grid read only

    the link dosnt have any info Wei Jie Fun. it shows "Sorry we could not find the requested page. Here are some resources that might be helpful to get you where you want to go". ... else should i make the expense form filed read only ?

  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: how to make a sub grid read only

    Hi,

    You can write a JS and associate to the button of grid.

    https://www.inogic.com/blog/2017/01/hide-add-button-on-a-subgrid-by-applying-custom-javascript-rule/

    Please also consider below :

    even you make the grid read only, but user still can create through many places like advanced find, excel, and etc.

    So, you need to spend extra point on above, such as create a plugin or workflow to prevent user create the record or edit the record if condition met.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans