Xrm.Page.ui.formSelector
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.
The table below lists all the members of Xrm.Page.ui.formSelector.
| Member | Type | Description |
|---|---|---|
|
Collection |
A Collection of all the form items accessible to the current user. |
|
|
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() + "'."); } };
Microsoft Dynamics CRM 2011
Send comments about this topic to Microsoft.
© 2013 Microsoft Corporation. All rights reserved.
Note