a!dynRetrieveMultiple() Function

Retrieves a collection of entities from Dynamics that match the given query.

See the Dynamics documentation for the RetrieveMultiple operation for details regarding the parameters and other remarks.

Syntax

a!dynRetrieveMultiple( scsExternalSystemKey, usePerUserCredentials, endpoint, parameters)

Common Parameters:

scsExternalSystemKey: (Text) The key from the Third Party Credentials admin console page that corresponds to the set of credentials that should be used to authenticate.

usePerUserCredentials: (Boolean) If true the credentials set in the Third-Party Credentials settings page by the current user running the expression will be used. If false the site-wide credential values will be used.

endpoint: (Text) The Dynamics organization endpoint URL. For example, "https://yourcompany.crm4.dynamics.com/XRMServices/2011/Organization.svc".

Specific Parameters:

parameters: (Any Type) The query, given as a dictionary with a field named FetchExpression that has a value in the Dynamics FetchXML format. Refer to the FetchXML documentation for information on building queries.

Returns

The function returns the standard connector result dictionary described in the main Connectors page.

If successful, the function returns a dictionary representation of an EntityCollection within the result field.

Notes

If called multiple times in the same expression with the same parameters, only one query is made to Dynamics when the expression is evaluated and the result is reused for each identical call. This caching only applies within a single expression evaluation. Return values are not cached in separate expressions, or in separate evaluations of the same expression.

Examples

Retrieve Multiple Accounts

Copy and paste the expression into the INTERFACE DEFINITION in EXPRESSION MODE, save it, then call the interface in a Tempo Report to test.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
=load(
  local!accounts: a!dynRetrieveMultiple(
    scsExternalSystemKey: cons!DYN_SCS_KEY,
    usePerUserCredentials: true,
    endpoint: cons!DYN_ENDPOINT,
    parameters: {
      FetchExpression:
        "<fetch mapping='logical' version='1.0'>
           <entity name='account'>
             <attribute name='name'/>
             <order attribute='name' descending='false' />
           </entity>
         </fetch>"
    }
  ),
  local!pagingInfo: a!pagingInfo(startIndex: 1, batchSize: -1),
  with(
    local!accountsDatasubset: todatasubset(
      local!accounts.result.Entities.Attributes,
      local!pagingInfo
    ),
    a!gridField(
      label: "Accounts",
      totalCount: local!accountsDatasubset.totalCount,
      columns: {
        a!gridTextColumn(
          label: "Name",
          field: "name",
          data: local!accountsDatasubset.data.name
        ),
        a!gridTextColumn(
          label: "Account ID",
          field: "accountid",
          data: local!accountsDatasubset.data.accountid
        )
      },
      value: local!pagingInfo,
      saveInto: local!pagingInfo,
      rowHeader: 1
    )
  )
)
FEEDBACK