Saturday, 12 May 2007

SMS Alerts from Salesforce [1] - Generating Alerts

This sample is going to generate an SMS alert to a customer's account manager whenever they log a Case. Alerts from Salesforce are generated as calls to external web services in response to workflow events. In Salesforce parlance they are called OutboundMessages.

Defining your Outbound Message

The first task is to setup an Outbound Mesage. When logged into Salesforce go to:

Setup > App Setup > Customize > Workflows & Approvals > Outbound Messages

The way outbound messages work, are to post an object to the external service. First step is to choose the object to post. In this example, we're going to choose Case.

Clicking next brings you to the definition screen where you specify:

  • message name
  • Endpoint URL (his doesn't need to exist while you're setting this up)
  • whether to pass the Session ID (checked, see below)
  • the fields from the Case object you want pushed to the endpoint.

The Session ID is important in our case becase we're going to need to call back into the Salesforce API to retrieve details of the Account (we've changed this to Customer in our installation so forgive me if I get this wrong going forward) against which the Case was raised and then onto the contact details for the Account Manager. Passing the Session ID, saves us from having to store username and password details elsewhere. I think it's a really neat feature of their API

Clicking Save gives you the completed message definition, mine's below.

We're now in a position to create the web service to receive the outbound messages, which will be the subject of the next post.

No comments: