Salesforce Data Sources

This section describes the parameters of the statement CREATE DATASOURCE SALESFORCE. We recommend creating Salesforce data sources and base views from the administration tool because it is much easier.

To define a Salesforce data source it is necessary to specify the following parameters:

  • OR REPLACE: If present and a Salesforce data source with the same name exists, the current definition is substituted with the new one.

  • FOLDER: Folder where the data source will be stored.

  • BASE_URL: URL of the Salesforce instance assigned.

  • API_VERSION: Version of the Salesforce API to consume: v40.0, v41.0…

  • AUTHENTICATION OAUTH20: Authentication data. The only authentication method supported is OAuth 2.0.

    • ACCESSTOKEN: OAuth 2.0 access token obtained when authenticating with Salesforce. Only mandatory for when AUTHENTICATION_GRANT is CODE_GRANT (web server flow).

    • AUTHENTICATION_GRANT: The possible values are CODE_GRANT or PASSWORD_GRANT.

      Only enter the following parameters if AUTHENTICATION_GRANT value is PASSWORD_GRANT:

      • USER_IDENTIFIER: Salesforce user name.
      • USER_PASSWORD: Salesforce user password.
      • USER_PASSWORD_TOKEN: Security token generated by Salesforce.
    • TOKENENDPOINTURL: URL of the OAuth 2.0 token endpoint.

    • CLIENTIDENTIFIER: Client identifier.

    • CLIENTSECRET: Client secret.

    • REFRESHTOKEN: OAuth 2.0 refresh token obtained when authenticating with Salesforce.

  • PROXY: If the HTTP requests are sent through a proxy, you have three options:

    • DEFAULT: the data source will use the default HTTP proxy configuration of the Server. See the section Default Configuration of HTTP Proxy of the Administration Guide to learn how to configure these default values.
    • ON: the data source will connect to the proxy specified by the parameters HOST and PORT. If the proxy requires authentication, you also have to provide the credentials of the proxy.
    • AUTOMATIC: provide the URL of a proxy.pac file that contains the configuration parameters of the proxy.
Syntax of the CREATE DATASOURCE SALESFORCE statement
CREATE [ OR REPLACE ] DATASOURCE SALESFORCE <name:identifier>
 [ FOLDER = <literal> ]
 BASE_URL = <literal>
 API_VERSION = <literal>
 <authentication>
 [ <proxy> ]
 [ DESCRIPTION = <literal> ]
 [ <sourceconfiguration> ]

<authentication> ::=
  AUTHENTICATION {
    OAUTH20 (
      ACCESSTOKEN = <token:literal> [ ENCRYPTED ]
      AUTHENTICATION_GRANT = {
         CODE_GRANT
       | PASSOWORD_GRANT (
           USER_IDENTIFIER = <literal>
           USER_PASSWORD = <literal> [ ENCRYPTED ]
           [ USER_PASSWORD_TOKEN = <literal> [ ENCRYPTED ] ]
         )
       }
      [
        [ TOKENENDPOINTURL = <literal> ]
        CLIENTIDENTIFIER = <literal>
        CLIENTSECRET = <literal> [ ENCRYPTED ]
        [ REFRESHTOKEN = { <token:literal> [ ENCRYPTED ] | VARIABLE <name of the variable:literal> } ]
      [
        AUTHORIZATIONSERVERURL = <literal>
        [ REDIRECTIONENDPOINTURL { DEFAULT | <literal> } ]
      ]
    )
  }

<proxy> ::=
  PROXY {
      OFF
    | DEFAULT
    | ON ( HOST <literal> PORT <integer> [ <credentials> ] )
    | AUTOMATIC ( PACURI <literal> )
  }

<credentials> ::= USER <literal> PASSWORD <literal> [ ENCRYPTED ]

<sourceconfiguration> ::= SOURCECONFIGURATION ( [ <source configuration property>  [, <source configuration property> ]* ] )

<source configuration property> ::=
  DELEGATEFETCH = <property value>
  | DELEGATEGROUPBY = <property value>
  | DELEGATEOFFSET = <property value>
  | DELEGATEAGGREGATEFUNCTIONSLIST = { DEFAULT | ( <function:identifier> [, <function:identifier> ]* ] ) }
  | DELEGATEOPERATORSLIST = { DEFAULT | ( <operator:identifier> [, <operator:identifier> ]* ] ) }
  | SUPPORTSAGGREGATEFUNCTIONSOPTIONS = <property value>

<property value> ::= true | false  | DEFAULT

If there is already a data source with the same name and the OR REPLACE clause is present, the existing data source definition is replaced by the new one.

To modify an existing Salesforce data source, use the ALTER DATASOURCE SALESFORCE statement.

Syntax of the ALTER DATASOURCE SALESFORCE statement
ALTER DATASOURCE SALESFORCE <name:identifier>
 [ BASE_URL = <literal> ]
 [ API_VERSION = <literal> ]
 [ <authentication> ]
 [ <proxy> ]
 [ DESCRIPTION = <literal> ]
 [ <sourceconfiguration> ]

<authentication> ::= (see CREATE DATASOURCE SALESFORCE for details)
<proxy> ::= (see CREATE DATASOURCE SALESFORCE for details)
<sourceconfiguration> ::= (see CREATE DATASOURCE SALESFORCE for details)