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 🙂

One thought on “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 ?

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *