Few more JavaScript for CRM


While searching for “how to hide new button” from related entity’s grid, these are certain things i found out

Suppose if we want to hide few things from the top bar of the CRM, where we could see New Activity, New Record etc.., we need to write  JavaScript in the following page

bar_Top.aspx within _root.

For e.g. if we want to hide ‘New Activity’ button than

<script type="text/javascript">
    function window.onload() {
        document.getElementById(‘mnu_new_activity’).style.display = ‘none’;


From entity’s grid, if we want to hide say assign button than we need to write JavaScript on the following page


<script language="JavaScript">

    function window.onload() {
       document.getElementById(‘_MBdoActioncrmGrid4assign’).style.display = ‘none’;

And for entity’s form it would

edit.aspx page for that entity.

for lead it would be


for invoice it would be

\SFA\invoice\edit.aspx etc..

However this way of using JavaScript is unsupported.

And lastly for hiding add existing button or new button from related entity’s grid, check this site




Author: Nishant Rana

I love working in and sharing everything about Microsoft.NET technology !

2 thoughts on “Few more JavaScript for CRM”

  1. Hello Nishant…

    I have put the following code in bar_Top.aspx under \CRMWeb\_root. I want to hide some link from activities grid drop down…

    I used following code but nothing is happening…. can you please guide me?

    function window.onload() {
    document.getElementById(‘btn_new_serviceappointment’).style.display = ‘none’;
    document.getElementById(‘btn_new_campaignresponse’).style.display = ‘none’


Please share your thoughts

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.