locked
remove add button for subgrid in crm 2013 RRS feed

  • Question

  • HI Friends,

       I have a requirement where I need to remove or disable add button or atleast not allow user to add any more records to subgrid once user clicks on a checkbox ( Checkbox is an option for user to make grid add functionality disabled )

    I have tried many ways but sub-grid disable is not working, neither we are able to remove add button.


    Thanks Regards Prashanth Kamasamudram Even the least work done for others awakens the power within; even thinking the least good of others gradually instills into the heart the strength of a lion.

    Friday, March 21, 2014 1:26 PM

Answers

  • Hi there

    You can make a JS development to hide the button depending on a condition.

    Bare in mind this is not a very Standard development it uses JavaScript DOMs and may have different behaviors on different Browsers, so you have to double check to make sure it works.

    Know, use a web developer tool to help you know the name of the button you want to hide.

    Then use following code:

     document.getElementById("button").style.display='none';
    Good Luck :)

    Monday, March 24, 2014 9:10 AM
  • Try this.

    http://garethtuckercrm.com/2013/11/25/dynamically-disable-ribbon-buttons-in-dynamics-crm/

    Monday, March 24, 2014 10:21 PM

All replies

  •   Any suggestions please...


    Thanks Regards Prashanth Kamasamudram Even the least work done for others awakens the power within; even thinking the least good of others gradually instills into the heart the strength of a lion.

    Monday, March 24, 2014 8:28 AM
  • Hi there

    You can make a JS development to hide the button depending on a condition.

    Bare in mind this is not a very Standard development it uses JavaScript DOMs and may have different behaviors on different Browsers, so you have to double check to make sure it works.

    Know, use a web developer tool to help you know the name of the button you want to hide.

    Then use following code:

     document.getElementById("button").style.display='none';
    Good Luck :)

    Monday, March 24, 2014 9:10 AM
  • Try this.

    http://garethtuckercrm.com/2013/11/25/dynamically-disable-ribbon-buttons-in-dynamics-crm/

    Monday, March 24, 2014 10:21 PM
  • Thank you tiagolvsantos, SPokharel,


         I knew that we can do it in javascript but the problem was that in CRM 2013 you need to make sure the page is fully loaded including complex controls like sub-grid.

         Initially I used this code in Form Load event

        
    function disableLink(link)
    {
    	document.getElementById(link).disabled=true;
    	document.getElementById(link).removeAttribute('href');    
    	document.getElementById(link).style.textDecoration = 'none';
    	document.getElementById(link).style.cursor = 'default';
    }

    But when I checked by clicking on + button of sub-grid. Its still working. Then I added following method to my script to make sure my form is fully loaded and accessable.

     
    $(document).ready(function(){ 
    		disableLink();// calling disableLink function after page is fully loaded
     }) 

    Thanks a lot friends, hope this will be helpful to someone who is looking out for same solution.

        


    Thanks Regards Prashanth Kamasamudram Even the least work done for others awakens the power within; even thinking the least good of others gradually instills into the heart the strength of a lion.

    Tuesday, March 25, 2014 8:06 AM
  • I tried this one form onload event, it can hide button a second, then display again, don't know why.

    Awen

    Tuesday, September 23, 2014 12:45 AM
  • use HideCustomAction

    For more click on

    http://www.powerobjects.com/blog/2011/10/20/how-to-hide-a-button-on-the-ribbon-in-dynamics-crm-2011/


    Hope this helps. ----------------------------------------------------------------------- Santosh Bhagat If this post answers your question, please click "Mark As Answer" on the post and "Vote as Helpful"

    Tuesday, September 23, 2014 8:42 AM
  • Hi,

    This can be done very easily with ribbon workbench.

    Create a Hide action. And append it to the commando of the form.


    Sreeni Pavalla

    Tuesday, September 23, 2014 12:13 PM
  • thanks for your reply.

    this solution is ok for simple hiding button, but I want to hide button based on some condition, such as one of fields value.


    Awen

    Wednesday, September 24, 2014 1:52 AM
  • I found that in order to hide the plus button from the subgrid using Ribbon Workbench, I also have to hide 'New', 'Add New' And 'Add Existing'.
    Friday, October 10, 2014 10:20 PM