Please wait, loading...

 

HIDE TABS IN AN ENTITY USING JAVASCRIPT IN MSCRM 2011 , 2013

February 14, 2014

function
 BalanceAccountTypeChange() {
    var GenralAccount = 100010002;
    var Bank = 100010003;

    var balance_account = Xrm.Page.data.entity.attributes.get(“new_balanceaccounttype” ).getValue();
    switch (balance_account) {
        case GenralAccount:
            Xrm.Page.ui.tabs.get(“GeneralJournalBatchesDetails” ).sections.get( “BalanceAccountTypeBank”).setVisible( false);
            Xrm.Page.ui.tabs.get(“GeneralJournalBatchesDetails” ).sections.get( “BalanceAccountTypeGeneralAccount”).setVisible( true);
            break;
        case Bank:
            Xrm.Page.ui.tabs.get(“GeneralJournalBatchesDetails” ).sections.get( “BalanceAccountTypeBank”).setVisible( true);
            Xrm.Page.ui.tabs.get(“GeneralJournalBatchesDetails” ).sections.get( “BalanceAccountTypeGeneralAccount”).setVisible( false);
            break;
        default:
            Xrm.Page.ui.tabs.get(“GeneralJournalBatchesDetails” ).sections.get( “BalanceAccountTypeBank”).setVisible( false);
            Xrm.Page.ui.tabs.get(“GeneralJournalBatchesDetails” ).sections.get( “BalanceAccountTypeGeneralAccount”).setVisible( false);
            break;
    }
}
// null values for feilds on balance account type change
function BalanceAccountTypeNullonchange() {
    Xrm.Page.getAttribute( “new_generalaccount” ).setValue(null );
    Xrm.Page.getAttribute( “new_bankaccount” ).setValue(null );
}

SOURCE : JUST2CODE.IN
Subscribe to our YouTube channel : https://www.youtube.com/user/TheRussell2012

https://i0.wp.com/microsoftdynamics.in/wp-content/uploads/2020/04/Microsoftdynamics365.png?fit=640%2C651&ssl=1
Microsoft Dynamics Community Profile

Learn more