Installing and Configuring the Salesforce Event Agent

Overview

The Salesforce Event Agent receives workflow events from your Salesforce instance. These are stored in a database for later retrieval and processing by a TaskCentre task step. It runs as a passive webservice on the server.

The Event Agent is available as part of the Salesforce Connector Tool pack, which includes the:

  • Salesforce Connector tool
  • Salesforce Event Agent

This article describes how to install and configure the Event Agent. For a detailed description of how to use both the Event Agent and the Connector tool, refer to the Salesforce Connector Tool Pack White Paper.

Installing the Event Agent

The Salesforce Event Agent can be installed on any compatible Microsoft Windows server. If required, you can install the Event Agent on the same server running the TaskCentre server.

Installation Prerequisites

  • The machine hosting the Event Agent must have a public IP address assigned for Salesforce to access. If required, use port-forwarding rules to keep the server behind your firewall.
  • You must be able to access a database instance (either Microsoft SQL Server or SQL Express), whether locally or over the network. If required, use the SQL Server instance running on the TaskCentre server.
  • Create an Application Pool in IIS Manager with the following settings:

    For more information about creating application pools, refer to the Microsoft Documentation.

Installing the Event Agent

When running the Event Agent installation package, note the following:

  • Site — If you have created a website in IIS specifically for the SalesForce Event Agent select it here, else leave this as Default Web Site
  • Virtual directory — Enter the name of the folder where contents of the above website are to be stored, else leave this as SFEventToolSetup
  • Application Pool — From the drop-down list, select the application pool created in Installation Prerequisites

A reboot is not required to complete the installation.

Configuring the Event Agent

Configuration Prerequisites

  • A TaskCentre user is required, who has:
    • Tool Access permission for the Salesforce Connector
    • Permission to create Script Objects (Any Object)

    For more information about creating TaskCentre users, refer to the TaskCentre 4.7 White Paper.

  • An SQL Server or SQL Express database user is required, who:
    • Can read and write to the database
    • Does not require Windows authentication

Creating the Notification Table

When installed, the Event Agent places a CreateTable Notifications.sql file in the c:\inetpub\wwwroot\<virtual_dir> folder — virtual_dir is the directory name you provided for the Virtual Directory parameter during installation (see Installing the Event Agent).

Copy this file to the machine hosting your Microsoft SQL Server or SQL Express instance, and execute it.

Configuring the Event Agent

It is recommended you configure the Event Agent by editing its web.config file.

The Event Agent’s web.config is installed to the c:\inetpub\wwwroot\<virtual_dir> folder — virtual_dir is the directory name you provided for the Virtual Directory parameter during installation (see Installing the Event Agent).

Change the following parameters’ values to suit your TaskCentre installation:

  • provider connection string — Use the following syntax, replacing the italic characters with your own values:
    "Data Source=database_hostname_or_IPAddress\database_type;Initial Catalog=SalesForceEvent;User ID=database_username;Password=database_password;MultipleActiveResultSets=True""

    where:

    • database_hostname_or_IPAddress is the hostname or IP address of the database server where the Notification table is stored. Use localhost if the database is installed locally.
    • database_type — Use either SQLServer for Microsoft SQL Server, or SQLExpress for SQL Express.
    • database_username and database_password are the credentials for the SQL Server or SQL Express database user created in Configuration Prerequisites.
  • TCHost — The IP address of the TaskCentre server
  • TCUsername and TCPassword — The credentials of the TaskCentre user created in Configuration Prerequisites

Configuration Required for Salesforce

First, create a Workflow Rule in Salesforce that triggers on an action, for example, when a new sales opportunity of a specific monetary value is created in the database.

Then create an Outbound Message for the above workflow rule’s Object, where the Endpoint URL is formatted as:
http://IP_Address:Port/virtual_dir/NotificateTaskCenter.asmx?writetodb=true

where:

  • IP_Address is the IP address of the server where the Salesforce Event Agent is installed and configured.
  • Portis the TCP port number the Agent is listening on. Typically, this is port 80, however, you can change this to suit your organisational needs:
    • Within IIS Manager, change the Bindings for the Default Web Site to the required port.
  • virtual_dir is the directory name you provided for the Virtual Directory parameter during installation (see Installing the Event Agent).

Optional Parameters for the Endpoint URL

If required, you can add additional parameters to the URL for storage in the Notification table:

  • param1 — Any parameter value. This is stored in the UserParam column of the Notification table for later use.
  • queuetask — A Task ID. If required, you can queue a task matching the ID when the row is retrieved.
    To get the Task ID:
    1. From TaskCentre, open the required task.
    2. From the General tab, click Options.
    3. Go to the Advanced tab.
      Task ID is in the Identification panel.

If all parameters were added, the endpoint URL would be as follows:
http://IP_Address:Port/virtual_dir/NotificateTaskCenter.asmx?writetodb=true&param1=<value>&queuetask=<value>

For a detailed description of the Notification table, refer to the Salesforce Connector Tool Pack White Paper.

Salesforce Integration Brochure

Salesforce Integration Brochure

Learn how integrating Salesforce with an ERP or industry specific application can save your organisation time and money and improve the visibility of critical data.

Download Brochure