Skip to main content
Tweeted twitter.com/StackSalesforce/status/1489342960965718018
deleted 2 characters in body
Source Link
Guy Clairbois
  • 10.7k
  • 32
  • 54

I am having the following error that I haventhaven't seen before:

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

I am using a customercustom 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;
    }
}

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

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

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 {
            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;
    }
}

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?

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?

Updated code
Source Link
manza
  • 2k
  • 5
  • 34
  • 58

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()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;
    }
}

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>

</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?

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?

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 {
            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;
    }
}

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?

Source Link
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?