Working on Account Entity. I have created 4 other forms based on account. The main form has a field called "Account Type" which is an option set contains a dropdown value 4 forms. When Account Type = 1, it will display the form within the main form. When Account Type =2, and so forth I would like to open the appropriate form OnChange
function new_showAccountForm() {
if (Xrm.Page.ui.getFormType()==2) {
var lblForm;
var accountType = Xrm.Page.getAttribute("new_account").getValue();
switch (relType) {
case 1:
lblForm = " Main";
break;
case 2:
lblForm = "Individual";
break;
case 3:
lblForm = "Individual3";
break;
case 4:
lblForm = "Individual4";
break;
default:
lblForm = "Main";
}
// Current form's label
var formLabel = Xrm.Page.ui.formSelector.getCurrentItem().getLabel();
if (Xrm.Page.ui.formSelector.getCurrentItem().getLabel() != lblForm) {
var items = Xrm.Page.ui.formSelector.items.get();
for (var i in items) {
var item = items[i];
var itemId = item.getId();
var itemLabel = item.getLabel()
if (itemLabel == lblForm) {
//Check the current form is the same form to be redirected.
if(itemLabel != formLabel) {
//navigate to the form
item.navigate();
} //endif
} //endif
} //end for
} //endif
} //endif
} //end function
*This post is locked for comments
I have the same question (0)