function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Web to Lead twist

I'm new to Salesforce development and have been tasked with a project that everyone thinks is doable, but I can't seem to find the right solution.
I'm developing for a third party where leads would be sent to different SF accounts. I will not have the username and password for the different accounts. I will have the SF login email address only. Based on that it seems that the API solution is no longer viable unless I missed something somewhere. I started looking into the Web to Lead. It appears that the OID is the unique value on the form. General SF users will not know how to retrieve this number from the html. I would like to use the SF email address as the key, is there any way to do so?
The second hurdle that I've run into are the fields on the Lead form. I would like to create my own format with a custom object and then submit the lead in the custom object format.
I'm looking for any assistance on this. With all of the development tools, there's got to be a way to accomplish these things.
Thanks in Advance.

What you need to do is go into each different organization and generate the web to lead html code, with the hidden OID field.

Then, in your code, associate each email address with the proper OID value. Then, submit the form.

That solution is not an option. Since I don't have the login credentials I cannot log into each account. The SF accounts that I want to send leads to are not under my control. I need a different solution.
Park Walker (TAGL)Park Walker (TAGL)
Are you trying to send leads to multiple instances (companies) or just multiple users within the same instance?
Actually I think the original posting was pretty clear:  the problem statement involves submitting leads to separate SFDC OrgIds (i.e. separate instances).

To answer the two posed questions:

1.  It seems doubtful that SFDC would allow you to query their entire DB of 650,000+ users by submitting an arbitrary username and getting back an OrgId.  Your problem statement is intriguing; I'd be curious to hear more about the actual business requirements - under what circumstances would you be presented with merely a SFDC username, and no clue as to the OrgId?  (Not that it matters to your original question, but I'm just curious.)

2.  You can add custom fields to your Lead object, and submit those in your web2lead form; but you cannot use the web2lead feature to do a "web2anything" submission to a custom object.  For "web2anything," you'll have to revert to API code and logging in as a trusted user (or scan AppExchange, I think a few vendors claim to offer something similar).  In practice, my firm often uses PHP for this.

Pretty much any probing requires some kind of logging in, or the OID.  Since you have access to neither option, I suggest the following:
1. Use the email address and send each person a note telling them how to generate the html.
2. Ask them to mail the html back to you.
3. You extract the OID from the html.

I know you feel generating the html is a pretty tough task for 'general SF users', but try it.  But if you give them detailed instructions, maybe with screenshots, I believe it's not that hard.


Thank you all for the suggestions.

Here's the business situation. I work for an independent lead generation company. We send leads to people who sign up for our service. We've had several people ask if we can submit leads to their accounts. I'm trying to avoid asking for their login credentials as that would introduce a security problem. I was hoping to use their SF account login name since that would be the easiest to obtain.

The flow of the app is this: a new lead comes into our system and a number of checks are done to determine who is eligible for the lead. Once that is determined, I retrieve the SF account credential and then submit via an http post with code to the appropriate account.

If we were only planning to integrate a few accounts total, generating the lead html would not be that big of a deal to acquire the OID. I anticipate 100's of subscribers and was looking for a solution that would be easy on the SF user.


OK - that makes sense.  You definitely don't need to ask your customers for login credentials.  I think the best bet here is to give customers concise instructions on how to find their OrgId, and have them send it to you.  I don't see a way around this.  It seems like a fairly minor administrative step as part of signing up a new customer.
If your clients are EE users (isn't everyone?), you can have them create an Outbound Message that contacts your server daily for updates. Basically, have a workflow rule that has a delayed one day trigger after it gets triggered. This delayed trigger can call an outbound message. Your service can then use the SessionID that gets passed to push an update of leads to their system, then update the record that caused the trigger so that it is rescheduled to trigger the next day... thus a once-a-day push of leads that won't require login credentials.

~ sfdcfox ~