Send Parameter From NavBarItem


Sometime we need to send parameter to our custom page from NavBarItem, but as NavBarItem does not support JavaScript property so we can pass parameter to our custom page using openIsvWin function (Unsupported)

Code to create NavBarItem

<NavBarItem Icon=”/_imgs/ico_18_debug.gif” PassParams=”1″ URL=”http://MyPage.aspx” Id=”MyItem”>
      <Titles>
         <Title LCID=”1033″ Text=”ISV Default” />
     </Titles>
 </NavBarItem>

Paste this code on formload event

navBarItem=document.getElementById(‘MyItem‘);
if(navBarItem!=null)
{
navBarItem .onclick = function() {

openIsvWin(‘http://MyPage.aspx?ParameterName=’+crmForm.all.ParameterFieldName.DataValue, false, -1, ”);

}}

Hope it will help somebody at right time 🙂

Advertisements

1 Comment

Filed under ISV, MS CRM 4.0

One response to “Send Parameter From NavBarItem

  1. AlexM

    Your script is very usefull but when i click on my navbaritem my onclic script is executed two times

    are you facing this problem too ?

Leave a Reply

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