Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Collections (client-side reference)

Collections (client-side reference)

Applies To: CRM 2015 on-prem, CRM Online

Collections are structures to provide access to data that represents an array, but without the ability to modify the data in the array.

The following list shows the collections that are available in the Xrm.Page object model:

  • Xrm.Page.data.entity. attributes: All the attributes on the page.

  • Xrm.Page.ui. controls: All the controls on the page.

  • Xrm.Page.ui. tabs: All the tabs on the page.

  • Xrm.Page.ui Tab. sections: All the sections in the tab.

  • Xrm.Page.ui Section. controls: All the controls in the section.

  • Xrm.Page.ui. navigation.items: All the items in the form navigation area.

  • Xrm.Page.ui. formSelector.items: All the forms available to the user.

  • Xrm.Page Attribute. controls: All the controls for the attribute.

  • Xrm.Page.data.process. getActivePath: The stages in the current active path based on branching rules.

  • The process getStages method for a process returned by Xrm.Page.data.process.getActiveProcess.

  • The stage getSteps method for stages returned by Xrm.Page.data.process.getActiveStage, Xrm.Page.data.process.getActivePath and Xrm.Page.data.process.getActiveProcess.

noteNote
The objects returned in the Xrm.Page.data.process namespace don’t contain names, so using the string parameter for the get method returns no objects.

With Microsoft Dynamics CRM Online 2015 Update 1, the Grid getRows method and Grid getSelectedRows method return collections of GridRow. More information: Grid objects and methods (client-side reference)

forEach
Apply an action in a delegate function to each object in the collection.

get
Get one or more objects from the collection depending on the arguments passed.

getLength
Get the number of items in the collection.

Applies the action contained in a delegate function.


          collection.forEach(delegate function(attribute, index))
Arguments
Delegate function with parameters for attribute and index.

Get one or more objects from the collection depending on the arguments passed.


          collection.get([String][Number][delegate function(attribute, index)])
noteNote
The get method for the Xrm.Page.data.entity.attributes collection is available using the Xrm.Page.getAttribute shortcut method.

The get method for the Xrm.Page.ui.controls collection is available using the Xrm.Page.getControl shortcut method.

Arguments
None
Return Value All the objects in the collection.
Type: Array

String
Return Value The object where the name matches the argument.
Type: Object

Remarks: The objects returned in the Xrm.Page.data.process namespace don’t contain names, so using the string parameter for this method returns no objects.

Number
Return Value The object where the index matches the number
Type: Object

delegate function(attribute, index)
Return Value Any objects that cause the delegate function to return true.
Type: Array

Get the number of items in the collection.


          collection.getLength()
Return Value
Type: Number

Microsoft Dynamics CRM 2015 and Microsoft Dynamics CRM Online
Send comments about this topic to Microsoft.
© 2015 Microsoft. All rights reserved.
Show:
© 2015 Microsoft