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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How hide add existing button of second sub-grid of same entity on different condition

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have a parent Entity A  related to Entity B twice (having two sub grids on Entity A). For a specific business scenarios I want to hide "+" button of first sub-grid and allow user to add records in second sub-grid.

I followed below blog and when I add custom java script rule it affects both sub-grids (apparently they are related to same entity). Is there any way we can differentiate one sub-grid from another sub-grid ?

https://ribbonworkbench.uservoice.com/knowledgebase/articles/489288-show-or-hide-the-add-new-button-on-form-sub-grid 

Appreciate your response

Shaik

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Somesh2207 Profile Picture
    1,563 on at

    [quote user="Shaik"]Is there any way we can differentiate one sub-grid from another sub-grid ?[/quote]

    Hi Shaik,

    You cannot do this in any supported way. Hiding the + button on the subgrid works at the entity level, and it will be applicable on all the subgrids of the entity everywhere. 

    There are 2 options for you here:

    1. If the users using the 2 plus button are different in security roles, you can deny the create permissions and the plus button will be hidden automatically for that user.

    2. If option 1 is not applicable for you, this is what I had done for one of our clients for the same requirement:

    • Hide the + button using Ribbon work bench, so both the subgrids wont have the plus button.
    • Add an HTML webresource on top of the both the grids, which has + button, and make the UI similar to CRM's plus button.
    • Write JS on Plus button to create the subgrid record and passing the data like parent and others using the CRM function.
    • You can show hide the web resources based on your business requirement using Xrm JavaScript.

    See screenshots below for reference. Please revert in case of queries/ questions. This is perfectly supported customization and the client has been using these for last 2 years now.

    Pic24092017_5F00_2.png

    The plus button above is custom HTML button.

    Pic24092017_5F00_2.png

    You can open the record with default values using Xrm.Utility.openEntityForm like below:

    Pic24092017_5F00_3.png

    Thanks

  • Verified answer
    Shaik Profile Picture
    Microsoft Employee on at

    Thanks Somesh for detailed answer.

    Yes we can differentiate two sub-grids with their relationship name. As per my scenario, the sub-grid record form is having one more sub-grid within it and some functionality tied to it, so developing custom HTML form adds more work and maintenance. But I like your idea.

    What I am planning is, to have another entity similar to the one existing and mimic the functionality of the older one (I know its not the best way of design, but left with no choice)

    Thanks,

    Shaik

  • Somesh2207 Profile Picture
    1,563 on at

    Hi Shaik,

    Thank you for your response. Your approach is also feasible, and would take lesser time to do.

    Just wanted to add to, also take into account any integration with this data. If some other system is dependent on this data, then your approach would have more maintenance, if not than this would work.

    In any case, can you please mark your or mine(if you feel it is helpful) answer or both as verified answer to close this thread.

    Happy CRMing

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans