Add JavaScript to NavBarItem in CRM 2011.

Suppose we want to add a new link on an entity’s form and want to call JavaScript on onclick of that link.

For doing so first we need to add a Navigation link on the form.

Click on Insert tab and Select Navigation Link button.

Specify Name and Icon and click on OK.

Save and Publish the customization, then open the form in IE Developer tool to get its id. We will use that id in our JavaScript function for onload of the form.

Our function


function OpenBing()
{
// get the navItem
var navItem = document.getElementById('navLink{6daba50b-300a-824b-453c-660e5b10781b}');

// override the onclick to call the connection page
navItem.onclick =function()
{
window.open("http://www.bing.com");
};
}

Clicking on Open Bing link opens up the Bing page.

Hope it helps.


Author: Nishant Rana

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

3 thoughts on “Add JavaScript to NavBarItem in CRM 2011.”

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s