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
Sumant KuchipudiSumant Kuchipudi 

How to make a visual force page public?

I have a requirement that ananymous user who doesn't requre login to access a page, fills the details, saves to an object (custom, and it has lookup field  to contact) . For this I have done the below steps
  • Added Domain
  • Created new Site
  • Assigned the created VF page in to the list 'Site Visualforce Pages'
  • Activated the site
  • Gave perrmissions (RWA) to the custom object
But when I click on the page I got the following error
Authorization Required

You must first log in or register before accessing this page.
If you have forgotten your password, click Forgot Password to reset it.
We should directly access to the page without authorize, how can we do this?
Thanks,
 
Dinesh MultaniDinesh Multani
It seems that you have not provided public access token. Please refer the below guide.
https://help.salesforce.com/articleView?id=000230066&type=1  
Vinod ChoudharyVinod Choudhary

Hi Sumant,

It looks like you already set all the permissions, can you the domain VF pages & Custom Object Permissions again to make sure it's correct.
what do you want to show on that VF public page,  did you check  "Custom Field-Level Security"  and "Custom Object Layouts".


Thanks
Vinod




 
Sumant KuchipudiSumant Kuchipudi
I have fixed this issue, I was able to figure out the issues with "Preview as Admin" from site. Thanks for all your support.
Akshay_DhimanAkshay_Dhiman
Hi Sumant Kuchipud,

This case you need to create a site in your Org and attach your VF page in your Site and set the access as public.

Search in Quick Box,'Site' and create a new site and Site must be active and public access.

https://developer.salesforce.com/page/An_Introduction_to_Force.com_Sites

Thank you.
Kumaresan S 5Kumaresan S 5
Hi Sumant,
 
You can refer this blog

http://devfacts.com/visual-force-page-public/