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
Dnyanesh Gawali 27Dnyanesh Gawali 27 

Record not inserted from visualforce page but not from sites

Hi All,

I have created a Visual force page for site user . so whenever i insert record on site ,it will give a error message and record is not inserted  .However when i click on preview visualforce and insert the data the record gets inserted. Can Anyone tell me the problem??
Apoorv Saxena 4Apoorv Saxena 4
Hi Dnyanesh,

Make sure that the Site User's Profile has the permission to create the record for the object you are trying to insert.

Hope this helps!

Please mark this question as Solved if you think your question was answered, so that others could view it as a proper solution.

Thanks,
​Apoorv
SandhyaSandhya (Salesforce Developers) 
Hi Dnyanesh Gawali,

Configure Public Access Settings for the site to allow Read and create access to the object for which you are inserting records.

Please refer below link for more information.

https://help.salesforce.com/HTViewHelpDoc?id=sites_public_access_settings.htm

http://blog.jeffdouglas.com/2010/04/27/create-a-new-record-in-force-com-sites/
 
Hope this helps you!

Please mark it as Best Answer if my reply was helpful. It will make it available for other as the proper solution.
 
Thanks and Regards
Sandhya

 
Swaraj Behera 7Swaraj Behera 7
Hi Driyanesh,

You need to give the access permissions through the Public Access Settings from site details page for the visulaforce pages and objects for the site guest users to access them on site.

Thanks,
Swaraj Behera