Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

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.

noteNote
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

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

Microsoft Dynamics CRM 2011
Send comments about this topic to Microsoft.
© 2013 Microsoft Corporation. All rights reserved.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft. All rights reserved.