function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Nate lindoNate lindo 

getting System.SObjectException: Field is not writeable: Contact.<unique text field> for tests

It is running as the current user  which has SA rights. Any thoughts on why this would occur? 
mukesh guptamukesh gupta
Hi Neta,

I think you  are trying to update RelationId field on the contact is not updatable and hence you are getting the errors.

if you need any assistanse, Please let me know!!

Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh 
Nate lindoNate lindo

The field I am trying to update is a custom unique free text field. Those articles did not appear to be relevent. 
Nate lindoNate lindo
the issue was due to the profile not having an assigned default record type