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
hgolovhgolov 

Allow public access to lead form

Hi,

I've created a vf page with a lead form that correctly inserts a lead using a custom controller. However, when I send the link to someone (or open in a different browser where I'm not logged in) the page requires login to access. The user type associated with the site is Guest User. I've set all the permissions that I think the page needs. How can I allow access to this page without login? Even a guest user still needs a login! Please help!!!

Best Answer chosen by Admin (Salesforce Developers) 
krishnagkrishnag

hi,

check the controller class definition.make sure you define the class

 

as

 

 

public with sharing class signup {

 

}

All Answers

krishnagkrishnag

hi,

check the controller class definition.make sure you define the class

 

as

 

 

public with sharing class signup {

 

}

This was selected as the best answer
hgolovhgolov
Thank you!
krishnagkrishnag

in your case if the above case didnot work u need to add the page to salesforce sites and us that link so that the guest user also can access. guest users can only be accessed if it is a public websites. Hope ur problem is solved.Let me know if u have any issues.

hgolovhgolov

Thanks for taking the time to help me. I actually do have another issue.  I"m using this page as a web-to-lead form with a custom controller. For some reason, some of my fields are not being stored. None of the custom ones, and not all of the standard ones. Would you have any idea why?