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
Subscribe to our YouTube channel : https://www.youtube.com/user/TheRussell2012