Apex Error: Field is not writeable

In Setup -> Security Controls -> Sharing Settings, you would need contacts to be set to Private vs Controlled by Parent in order to be able to write to that field.

On a side note, you may want to also look into moving your groupId query outside of your for loop. You should also be able to access the xrx_mf_crm__Region_1__c field without querying for it by looping through the list of records in the trigger something like:

for (Contact contact : Trigger.new)

It looks like there is a blog post that should help you through this trigger too, here.

Tags:

Apex

Error