• sara_c
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

 

The below yields Error: Compile Error: Field is not writeable: ContactShare.ContactId at line 5 column 21   This error message must be something different then what it's telling me.

How / Why is contactID not writable?

 

Just a quick example....  all comments on bad coding practices of not bulk enabling the trigger and hardcoding an id aside.. :)

 

 

trigger ContactCheckReferral on Contact (after insert ) {   
            for (Contact c : Trigger.new) {
                if(c.Consent_to_participate_in_network__c) {
                    ContactShare cs = new ContactShare();
                    cs.ContactId = cs.id;
                    cs.UserOrGroupId = '00GS0000000Ub0mMAC';
                    insert cs;
                }                           
            }
}

 

 

  • June 30, 2010
  • Like
  • 0