locked
CRM 2011: Navigation link External link RRS feed

  • Question

  • Hi guys,

     

    Could you please tell me how to change change the navigation's link using Jscript in run time?

    When I use Xrm.Page.ui.navigation.items.get('nav_id') --> it returns a object a doesn't have a method for me to change the external link.

     

    Thanks in advanced.

    Tuesday, August 30, 2011 12:05 PM

Answers

  • Hello all,

     

    Thank you for your help. I finally find a way to overload navigation's onclick event:

    var navigationElement = document.getElementById('nav_id');

        if (!isUndefined(navigationElement)) {

            /* Override onclick handler to change the target link */

            navigationElement.onclick = function onClickHandler() {

                loadIsvArea(Mscrm.CrmUri.create("http://www.google.com"), false);

            }

        }

    :D

    • Marked as answer by Linh Giang Wednesday, August 31, 2011 7:10 AM
    Wednesday, August 31, 2011 7:09 AM

All replies

  • To stay supposed I would suggest adding a custom link pointing to your external link and then hiding/showing the custom link based on your requirements.

    You can use this to hide/show the left nav item:

    Xrm.Page.ui.navigation.items.get('nav_id').setVisible(false);
    



    Blake Scarlavai - http://mscrmdev.blogspot.com/ - Sonoma Partners - http://www.sonomapartners.com/
    Tuesday, August 30, 2011 7:37 PM
  • Hi,

    The navigation item object will be loaded once user click on the navigation item button and then only you can change the external link. Instead of adding a Navigation link you can add a new tab and section with Iframe on a form and can change the external link as per required.


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    • Proposed as answer by Jehanzeb.Javeed Wednesday, August 31, 2011 12:22 AM
    Wednesday, August 31, 2011 12:22 AM
  • Hello all,

     

    Thank you for your help. I finally find a way to overload navigation's onclick event:

    var navigationElement = document.getElementById('nav_id');

        if (!isUndefined(navigationElement)) {

            /* Override onclick handler to change the target link */

            navigationElement.onclick = function onClickHandler() {

                loadIsvArea(Mscrm.CrmUri.create("http://www.google.com"), false);

            }

        }

    :D

    • Marked as answer by Linh Giang Wednesday, August 31, 2011 7:10 AM
    Wednesday, August 31, 2011 7:09 AM