• Raghavendra Raju K S
  • NEWBIE
  • 0 Points
  • Member since 2015
  • Consultant
  • HCL Technologies Ltd.

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

Hi,

In person account type,i need to change the field access levels to 'edit' using apex trigger,but for person account record type the contact sharing setting will be controlled by parent, when i tried to write trigger code on account, to chane the contact field access levels,i am getting error like below 

 

Error: Compile Error: Field is not writeable: ContactShare.ContactAccessLevel at line 91 column 18  


the code is 

 

ContactShare cs = new ContactShare();

 cs.ContactAccessLevel = 'Edit'; 

 cs.ContactId = contact.Id;   

 Database.SaveResult accountInsertResults = Database.insert(cs, false);

 

Please help me