As you can have multiple forms in Microsoft Dynamics CRM you may wish to navigate to a particular form from JavaScript.
The function below can be used to change the currently selected form.
ChangeForm("Test Form");
function ChangeForm(formName) { var currentForm = Xrm.Page.ui.formSelector.getCurrentItem(); var availableForms = Xrm.Page.ui.formSelector.items.get(); if (currentForm.getLabel().toLowerCase() != formName.toLowerCase()) { for (var i in availableForms) { var form = availableForms[i]; // try to find a form based on the name if (form.getLabel().toLowerCase() == formName.toLowerCase()) { form.navigate(); return true; } } } }
Leave a comment