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
TechEye CreationsTechEye Creations 

Creating a publicly accessible SURVEY FORM using Salesforce.com

Hi,

 

One way of creating a publicly available survey form is to create a web-to-lead form. The HTML/PHP survey form (which is mapped to lead) can then be posted on your website .. or else you can send the accessible URL to your clients via email or page redirection.

You can use PHP/javascript to compute survey score, if that is needed too, and map is to Salesforce.com Lead field using web-to-lead.

Once the survey is completed the survey results will be captured in lead. You can keep a flag to identify survey leads from other type of business leads.

 

In case you want to capture the survey results in a different custom object (e.g., Survey) then you can write a trigger (After_Insert) on Lead to copy those survey values from Lead to the custom object and delete the rest of the survey leads (Note you cannot delete the lead on which you are currently accessing).

 

Thanks

sfdcfoxsfdcfox

Or you can use Visualforce, host the entire thing on Force.com, and skip the Lead record entirely, with the only downside being that if your instance is down for maintenance, then the form won't work. If you stay with the Web to Lead method, you can delete the current Lead in an after insert trigger by using a @future method, since that row will be unlocked by the time the @future method has a chance to execute.