I am having the following error that I haven't seen before:
System.VisualforceException: Update access denied for Contact, controller action methods may not execute
I am using a custom controller.
public without sharing class TestController {
public Contact myCon {
get {
myCon = [SELECT Id, Name, FirstName, MobilePhone FROM Contact WHERE Id =: '003N000000SDkc6'];
return myCon;
}
set;
}
public TestController() { }
public void test(){
System.debug('@@ ' + JSON.serialize(myCon));
update myCon;
}
}
and a Visualforce Page:
<apex:page showHeader="true" sidebar="true" controller="TestController">
<apex:form>
<apex:inputText value="{!myCon.MobilePhone}" />
<apex:commandButton value="save" action="{!test}" />
</apex:form>
</apex:page>
The page is in a Salesforce site. I know that sites has limitation with editing, but I have similar code in other orgs, and I have been able to update opportunities.
I don't know what I am doing wrong or if there is an extra set up in the site that I am not aware off?