a!dynUpdate() Function

Updates a business object in Dynamics.

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

Syntax

a!dynUpdate( 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 entity to update, given as a dictionary with the same field structure as a Dynamics Entity. The given properties will be updated.

Returns

Writer

This function returns a writer and must be used with the bind() function.

See also:

Examples

Update an Account

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
43
44
45
46
47
48
49
=load(
  local!accountId,
  local!accountName,
  local!accountUrl,
  local!dynUpdateWriter: bind(
    null,
    a!dynUpdate(
      scsExternalSystemKey: cons!DYN_SCS_KEY,
      usePerUserCredentials: true,
      endpoint: cons!DYN_ENDPOINT,
      parameters: _
    )
  ),
  {
      a!textField(
        label: "Account Id to Update",
        value: local!accountId,
        saveInto: local!accountId
      ),
      a!textField(
        label: "Updated Account Name",
        value: local!accountName,
        saveInto: local!accountName
      ),
      a!textField(
        label: "Updated Account Website",
        value: local!accountUrl,
        saveInto: local!accountUrl
      ),
      a!buttonArrayLayout(
        buttons: {
          a!buttonWidget(
            label: "Update",
            value: {
              Entity: {
                LogicalName: "account",
                Id: local!accountId,
                Attributes: {
                  { Key: "name",       Value: local!accountName },
                  { Key: "websiteurl", Value: local!accountUrl  }
                }
              }
            },
            saveInto: local!dynUpdateWriter
          )
        }
      )
  }
)
FEEDBACK