Hi,
We are using multiple forms for account entity ( Main Account and Sub Account). Based on the parent account lookup value switching the forms. If parent account contains data it means sub account else main account. Form switching is working fine.
But when we are adding a new sub account from main account “save and close” is not working as expected.
Below script used for switching the forms.
function navigateForm() {
var formToNavigate = "MainForm";
var currentForm = Xrm.Page.ui.formSelector.getCurrentItem().getLabel();
var formType = Xrm.Page.ui.getFormType();
var parentAccount = Xrm.Page.getAttribute("parentaccountid");
if (parentAccount.getValue() != null) {
formToNavigate = "SubForm";
}
if (currentForm != formToNavigate) {
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 == formToNavigate) {
item.navigate();
}
}
}
}
Could you please let me know if you have any idea on this.
Thanks,
Venky
*This post is locked for comments
Mohamed Amine Mahmoudi
83
Super User 2025 Season 1
Community Member
54
Victor Onyebuchi
6