locked
How to hide the toolbar button in main crm page RRS feed

  • Question

  • Hi,

    I need to hide the toolbar button in main crm page.

    Can anybody provide me the sample JavaScript code for this scenario.

     

    Thanks,

    Yadav 


    Naveen MSCRM Technical Consultant
    Wednesday, February 9, 2011 7:27 AM

Answers

  • Hello Yadav,

    1. Find the element id using IE 8.0 development toolbar
    2. Once you find out the element id you can use code like this:
    var anyButton = document.getElementById("elementId");
    
    if (anyButton != null)
    {
     anyButton.style.display = 'none';
    }

    Wednesday, February 9, 2011 8:04 AM

All replies

  • Hello Yadav,

    1. Find the element id using IE 8.0 development toolbar
    2. Once you find out the element id you can use code like this:
    var anyButton = document.getElementById("elementId");
    
    if (anyButton != null)
    {
     anyButton.style.display = 'none';
    }

    Wednesday, February 9, 2011 8:04 AM
  • Hi, You must edit the homepage.aspx (can be found in %programfiles%\Microsoft Dynamics CRM\CRMWeb\ . You can insert custom javascript code there, on the initialize function to hide your field programmatically.
    Cornel Croitoriu - Senior Software Developer - www.Biz-Forward.com
    Wednesday, February 9, 2011 9:55 AM
  • Hi Ali,

    I have to Hide/Unhide a "New" Button from the Business Unit Form NOT from Ribbon Menu based on Security Role.

    I know if i do not give the "Create" privilege in BU entity in the security role then users can not create a New BU, but in CRM for other Reasons i am forced to give them the Rights to Create. The only way i can restrict users NOT to create BU by hiding the New button from the Form Menu.

    I know how to hide New button from Ribbon Menu. But how can i hide the New button from BU form without using JavaScript? I am not big fan of JScript and not proficient as well.

    Is there any supported way other that JavaScript to Hide/Unhide the New button from the FORM Menu. If at all not possible without JScript, is there any sample code available.

    To Clarify, CRM does not have a place for Business Unit in Any modules other than Settings Area.

    If you navigate like this :

    Settings -> Administration -> Business Units -> then in the Right hand side i can see the New button in the Menu not into the Ribbon not into the Form, i do not know what we call that menu, where you can find "Print", "Run as Workflow" buttons.

    I want to hide the "New" for that Menu option/Tool Bar.

    As per Cornel in this thread, he is suggesting to Write a JScript directly into the CRM Mainpage.aspx which is unsupported and i am not allowed to do that.

    Can you help me out.

    Thanks.


    Puneet Joshi

    Thursday, April 12, 2012 3:40 PM
  • Hi Puneet

    Sorry for replying late.

    I don't think you can hide the button on entity form without using JavaScript. If so, then this is not in my knowledge.

    By the way, it is not so difficult to learn JavaScript. Give yourself some kick start and you will be running on the way :)

    Best of luck :)


    Paradise lies at the feet of thy mother. - Prophet Mohammed (PBUH) (skype: ali.net.pk)

    Wednesday, April 25, 2012 10:17 AM
  • Well, I can write Jscript that is not a problem at all. reason not using Jscript :

    • During a slow page load the button will be visible and accessible and user can click on it.
    • If you encounter a JavaScript error on the form, script may not hide the button.

    I am looking for more supported way.

    @Cornel: Your option to implement my requirement is unsupported customization. I am not allowed to modify the OOB aspx pages.

    Another option i was thinking to hide the Save, Save and Close and Save and New button from the Business Unit form. But again BU does not have a Ribbon.xml file, i tried to search in CRM SDK.

    If anybody has implemented this in a supported way, please share.

    Thanks.


    Puneet Joshi

    Thursday, April 26, 2012 3:32 PM