Tuesday, September 18, 2012

Crm 2011 - Hiding navigation item based on two option(bit) value

function hideGunTransactionEntries()
{
        
        var isLockedfield=Xrm.Page.data.entity.attributes.get("jmh_lockedbypolice");
if(isLockedfield != null)
{
        var isLockedfieldValue=isLockedfield.getValue();

if(isLockedfieldValue == 1)
{

    var objNavItem = Xrm.Page.ui.navigation.items.get("nav_jmh_jmh_gun_jmh_guntransactionentry_gun");
    objNavItem.setVisible(false);

}
else
{

    var objNavItem = Xrm.Page.ui.navigation.items.get("nav_jmh_jmh_gun_jmh_guntransactionentry_gun");
    objNavItem.setVisible(true);

}
}
}

No comments:

Post a Comment