a!sfcDelete() Function

Removes a business object from Salesforce. For more information on what objects can be deleted and the permissions needed to delete objects refer to the Salesforce API documentation for the delete operation.

Syntax

a!sfcDelete( scsExternalSystemKey, usePerUserCredentials, endpoint, ids)

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 Salesforce endpoint URL to use for authentication. Possible values are "https://login.salesforce.com/services/Soap/u/27.0", which is used for production and development environments, and "https://test.salesforce.com/services/Soap/u/27.0", which is used for the Salesforce "sandbox" test environment. Update the 27.0 portion of the endpoint URL to match the version of the API that you are accessing. As a best practice, create a constant for this value.

Specific Parameters:

ids: (Text Array) The ids of the objects in Salesforce to delete.

Returns

Writer

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

See also:

Examples

Delete Objects with the Given IDs

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
=load(
  local!ids:{},
  local!deletedItems: bind(
    null,
    a!sfcDelete(
      scsExternalSystemKey:cons!SALESFORCE_SCS_KEY,
      usePerUserCredentials: true,
      endpoint: cons!SALESFORCE_ENDPOINT,
      ids: _
    )
  ),
  {
      a!textField(
        label: "Items to delete",
        instructions: "Enter a comma-separated list of IDs of the objects to delete (no spaces)",
        required: true,
        value: local!ids,
        saveInto: a!save(
          local!ids,
          fn!split(save!value, ",")
        )
      ),
      a!buttonLayout(
        primaryButtons: {
          a!buttonWidget(
            label: "Delete",
            value: local!ids,
            saveInto: local!deletedItems
          )
        }
      )
  }
)
FEEDBACK