Xrm.Page.ui.formSelector

[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.

Note

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.

Members

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

Member Type Description

Xrm.Page.ui.formSelector.items Collection

Collection

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

getCurrentItem method

Method

Returns a reference to the form currently being shown.

getCurrentItem method

Returns a reference to the form currently being shown.

Xrm.Page.ui.formSelector.getCurrentItem()
  • 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() + "'.");
 }

};

Members

See Also

Tasks

Sample: SDK.FormSelectorSamples.js

Reference

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

Concepts

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.