[Applies to: Microsoft Dynamics CRM 2011]

Xrm.Page.ui.formSelector contains the items collection of all the forms available for the user as well as a method to retrieve information about the form currently in use.


When there is only one form available the Xrm.Page.ui.formSelector.items Collection is empty and the getCurrentItem method will return null.

Only those forms that share an association with one of the user’s security roles are available in this collection. This collection provides methods to retrieve or perform actions on each of the forms, including the ability to navigate to a specific form.

Examples shown are in the Sample: SDK.FormSelectorSamples.js library.


The table below lists all the members of Xrm.Page.ui.formSelector.

Member Type Description

Xrm.Page.ui.formSelector.items Collection


A Collection of all the form items accessible to the current user.

getCurrentItem method


Returns a reference to the form currently being shown.

getCurrentItem method

Returns a reference to the form currently being shown.

  • Return Value
    Type: Object

**Example:**The SDK.FormSelectorSamples.getCurrentItemName function gets the current form item, and displays its name to the user.

SDK.FormSelectorSamples.getCurrentItemName = function () {
 var item = Xrm.Page.ui.formSelector.getCurrentItem();
 if (item == null) {
  alert("Only one form is available.\n The Xrm.Page.ui.formSelector.getCurrentItem method will return null when only one form is available.");
 else {
  alert("The current form item's name is '" + item.getLabel() + "'.");



See Also


Sample: SDK.FormSelectorSamples.js


Xrm.Page.ui.formSelector.items Collection
Xrm.Page.ui.formSelector item methods


Form Scripting Quick Reference
Write Code for Microsoft Dynamics CRM Forms
Use the Xrm.Page Object Model

Microsoft Dynamics CRM 2011
Send comments about this topic to Microsoft.
© 2013 Microsoft Corporation. All rights reserved.