• davesharp
  • 0 Points
  • Member since 2012

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
  • 0

Hi Folks,


I have assigned 4 custom boolean fields to the Contacts and these are for users to update which email they would like to subscribe too, such as Monthly Newsletter, New Courses etc.


I am trying to create a page on our force.com site that displays the 4 checkboxes with a save button, so we can attach a link to the bottom of the emails we send for users to update their subscriptions to the emails we send them.


Visualforce Page:


<apex:page Controller="EmailSubscriptionController">
    <apex:form >
        <apex:messages />
        <br />

        <apex:inputCheckbox id="Brochure_email__c" value="{!contact.Brochure_email__c}"/>Brochure Email<br />
        <apex:commandButton value="Save" action="{!save}"/>



Apex Class:


public class EmailSubscriptionController {

    public final Contact contact;
    public ID get_id {get;set;}
    public boolean email_brochure {get;set;}

    public EmailSubscriptionController() {
        contact = [SELECT Brochure_email__c  FROM Contact
            WHERE Id = :ApexPages.currentPage().getParameters().get('id')];

    public Contact getContact() {
        return contact;

    public PageReference save() {

        try {
        } catch(System.DMLException e) {
            return null;

        return null;



The code shows me the force.com page fine, and check's the relevant boxes, but when i click update it gives me the following error message:


system.security.NoAccessException: Update access denied for Contact


Any ideas on how i can get this working?


Many Thanks