locked
Xrm.Page.getControl not working RRS feed

  • Question

  • I'm doing an upgrade from CRm 4.0 to CRM 2011. I'm trying to update the following line of code:

    document.getElementById("nav_intrastudent").style.display='none';
    alert(document.getElementById("nav_intrastudent"));
    

    to use Xrm.Page.getControl, like this:

    var control = Xrm.Page.getControl("nav_intrastudent");	
    
    alert(control);

    The first alert works, the second one is null. I can't see anything wrong with the Xrm.Page.getControl statement. Any ideas?

    Thanks

    Monday, February 10, 2014 4:55 PM

Answers

  • Try this :

    var control = Xrm.Page.ui.navigation.items.get("nav_intrastudent");



    • Edited by CRMDevlpr Monday, February 10, 2014 5:45 PM
    • Marked as answer by crmNewbie1978 Monday, February 10, 2014 5:58 PM
    Monday, February 10, 2014 5:45 PM