Monday, August 17, 2009

Reorder Navigation Items in MSCRM 4.0

if(document.getElementById('crmNavBar'))
{
//arrabge the navigation Item in order you want to display
var oTempArray = new Array('navInfo','nav_new_account_new_accountplan','nav_new_account_new_accountserviceline','navContacts','navAddresses','navActivities', 'navActivityHistory', 'navSubAct','navRelationships','navOpps','navQuotes','navOrders','navInvoices','navService','navContracts','navListsInSFA','navCampaignsInSFA');
var i; var iStartIndex = 0;
// total no of navigation items defined in the oTempArray variable
var iEndIndex = 10;
var iEndObject = document.getElementById(oTempArray[iEndIndex]);
for(iStartIndex; iStartIndex <= iEndIndex; iStartIndex++ )
{
if(document.getElementById(oTempArray[iStartIndex]))
{
i = document.getElementById(oTempArray[iStartIndex]);
i.parentNode.parentNode.insertBefore(i.parentNode, iEndObject.parentNode );
}
}
}

No comments: