web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :

Javascript – Form Navigate

Neil Parkhurst Profile Picture Neil Parkhurst 10,727 User Group Leader

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;
      }
    }
  }
}

Comments

*This post is locked for comments