3

Basically I need to create a web application that contains a web to lead form. Upon submission of the Lead, I need to get the record ID and details of that Lead in my web application, which is obviously external to Salesforce.com. Any thoughts how I can go about doing this? Thanks!

2 Answers 2

5

Config solutions

You could define a workflow rule?

  1. Firing condition would be on lead creation (when certain criteria are met like stuff defined here + any fields you decide to have in the form)
  2. Action would be an outbound message flying back to your website.
  3. If not an outbound message - maybe an email alert going to dedicated mailbox that's readable by your app.
  4. Scheduled report sent to an user whose email happens to be monitored by your website ;)

Coding solutions - SF as the actor

  1. REST callout to your site, defined as @future in the "after insert" trigger on Lead.
  2. Scheduled batch job running hourly? daily? sending Ids of recently created leads.

Coding solutions - your page as the actor

All above are asynchronous, you don't wait for the answer, you get the message / email some time later. Means you'd have to store "unmatched leads" somewhere.

If that's unacceptable - you could ditch the web2lead process and create your own integration (via SOAP or REST), there are high chances you'll find something for yourself at http://wiki.developerforce.com/page/Data_Integration. Basically the create() call would return to you with either the error or lead's Id...

Or just ask by sending a query ;) Or being notified via Streaming API ;) Plenty of options really.

7
  • Thanks so much. I'm going to have a look at these and see which ones work for me. The thing is I basically need an "instant" response to say who the Lead was assigned to.
    – user988
    Commented Jan 13, 2014 at 17:16
  • Outbound message, email etc should include the field because salesforce.com/us/developer/docs/apexcode/Content/… says the assignment rules are before workflows; but it'll be async. The SOAP/REST API call will out of the box return you only the generated lead's Id. You'd have to query (check retrieve call) for the Owner yourself... One more option - build a webservice you'd be calling from your app, there you'll have full control over what's returned.
    – eyescream
    Commented Jan 13, 2014 at 17:31
  • Last thing - is it really you (=your app) that needs to know the owner? or is it the lead? Web2Lead offers option to send them an email based on email template. So you could pull of something like "welcome, blah blah, your account manager will be John Doe..."
    – eyescream
    Commented Jan 13, 2014 at 17:33
  • basically it's a call script and the agent who's submitting the form needs to know who the Lead was assigned to instantly, while they are still on the line with the customer (they don't have SFDC licenses)
    – user988
    Commented Jan 13, 2014 at 18:17
  • Last idea I promise :P Visualforce page exposed as Site. Doesn't need PHP/C#/Java/etc coding skills or learning of integration API. You could easily check in SF for duplicates, display their related data maybe...
    – eyescream
    Commented Jan 13, 2014 at 19:53
1

You would need to use the SOAP or REST API. The web-to-lead form in salesforce.com doesn't actually generate the lead "immediately" but places it in a queue for asynchronous processing, thus no information about the lead is available until some time later.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .