Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get notified of a new lead in SalesForce? [closed]

I want to get notified when a new lead is created in Salesforce. Is there something like webhook in Salesforce or some other way to achieve this?

like image 552
Ajmal VH Avatar asked Oct 29 '12 12:10

Ajmal VH


People also ask

Can you set up alerts in Salesforce?

From Setup, in the Quick Find box, enter Notification Builder , and then select Custom Notifications. Click New, and then select Salesforce Desktop or Mobile. Add your Custom Notification Name and API Name, and notification channels. Sends a notification to the desktop notification tray.

What triggers lead assignment rule in Salesforce?

A Lead assignment rule consists of multiple rule entries that define the conditions and order for assigning cases. From a Salesforce User interface, a user can trigger assignment rules by simply checking the Assign using the active assignment rules checkbox under the optional section.


2 Answers

Yes, plenty of options :)

For Salesforce as actor:

  1. Workflow rule that would fire on insert of Lead and send you an email (or if it's for system integration - outbound message).
  2. You can always write an "after insert" Apex trigger and have in it a callout to external system (SOAP and RESTful APIs are supported). Although you'll need a @future annotation because the triggers by default aren't supposed to send callouts (the database commit/rollback shouldn't depend on whether the external system has accepted the message or not).

For external system as actor:

  1. Simply poll every once in a while for something like [SELECT Id FROM Lead WHERE CreatedDate > :lastTimeIhaveChecked]
  2. Or there's fairly recent addition called Streaming API. Basically you define a PushTopic (query that interests you). Salesforce peeks at the current results returned by it and whenever the results change you'll get a notification. I haven't played with it yet but seems from the docs you can set event type to show "created" events only. This might be closest to a webhook.
like image 190
eyescream Avatar answered Nov 14 '22 14:11

eyescream


I hate to self-promote but since some might fine this as a useful answer... I built a Webhook creator for Salesforce. It is open source: https://github.com/jamesward/salesforce-webhook-creator

like image 43
James Ward Avatar answered Nov 14 '22 14:11

James Ward