Skip to main content
1 of 3
manza
  • 2k
  • 5
  • 34
  • 58

System.VisualforceException: Update access denied for Contact, controller action methods may not execute

I am having the following error that I havent seen before:

System.VisualforceException: Update access denied for Contact, controller action methods may not execute

I am using a customer controller.

public without sharing class TestController {
    public Contact myCon {get ; set; }

    public TestController() {
        myCon = [SELECT Id, Name, FirstName, MobilePhone FROM Contact WHERE Id =: '003N000000SDkc6'];
    }

    public void test(){
        System.debug('@@ ' + JSON.serialize(myCon));
        update myCon;
    }
}

an 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 limition with editing, but I have similar code in other orgs, and I have been able to update opportunities.

I dont know what I am doing wrong or if there is an extra set up in the site that I am not aware off?

manza
  • 2k
  • 5
  • 34
  • 58