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
CarlBCarlB 

Custom field not writeable for Sites user

Hello.

 

I am writing a Visualforce controller that creates a custom object.  The controller is for a page in a Sites site.

 

The code compiles ok, but when I run it, I get the error "Field is not writeable".

 

When I go to the Sites user profile, all the fields are visible and the object has all the permissions (read/create/edit/delete/view all/modify all)

 

Any thoughts?

 

Carl

MTBRiderMTBRider

Does this site require a login or does it use a guest account?  If guest account, did use the "Public Access Settings" button to set the permisions? 

souvik9086souvik9086

Go to your site name and click Public Access Settings and check the permission for the field concerned.

CarlBCarlB

Hello.

 

Thanks for the replies.

 

The Site is publicly accessable.

 

The permissions that I mentioned in my email were accessed by going to Setup -> Develop -> Sites -> [ My Site ] -> Public Access Settings.

 

If I scroll to the "Field-Level Security" section and click on "View" beside my custom object, all of the fields are ticked as visible and most of the fields do not have the read-only box ticked.

 

In the "Custom Object Permissions" section for my custom object, all the boxes are ticked.

 

Oddly, I think it was working, but then I had to update the managed package that contained my custom object, so I am wondering if there is a bug in Salesforce.

 

Regards,

 

Carl

sravan36sravan36

Hi Carl

 

In sites, If that is Customer Portal then you are not able to Insert or Update even not able to display some standard objects directly for example Account and Contact etc. Make sure you are updating/ Inserting field is not a formula or autonumber field.

 

Cheers!!!!

 

 

CarlBCarlB

Hello.

 

It is not a Customer Portal.

 

The field in my custom object is a text field.

 

Regards,

 

Carl