Print this page

Why do I get 'Field is not writeable: OpportunityTeamMember.OpportunityAccessLevel' when creating an Opportunity team member through the API?

Knowledge Article Number 000003208

I am trying to create Opportunity team members via the API but I am getting an error:

insert new opportunityteammember(OpportunityAccessLevel='Edit', OpportunityId='0062000000NJf7pAAD', TeamMemberRole='Account Manager', UserId='005200000012QNOAA2');

COMPILE ERROR: Field is not writeable: OpportunityTeamMember.OpportunityAccessLevel


If an organization has Organization Wide Defaults set to Private for Opportunities, OpportunityTeamMember.OpportunityAccessLevel is not editable through the API. OpportunityTeamMember records can still be created if the OpportunityAccessLevel field is not specified (will default to 'Read'):

insert new opportunityteammember(OpportunityId='0062000000NJf7pAAD', TeamMemberRole='Account Manager', UserId='005200000012QNOAA2');

promote demote