[SalesForce] Setting a Campaign Member RecordType automatically based on the Campaign RecordType

So far I've seen the Campaign Member Record Type is set based on the Campaign Member Type field which the Campaign has.

What I need is to set the Campaign Member RT based on the Campaign's RT. Is there any way of doing this?

So far I've tried with Workflows and Process Builder, but the field wasn't available, which leaves me only to triggers. The problem is I wanted a fairly standard way. Any ideas?

Best Answer

All the CampaignMember records associated to a Campaign record possess the same RecordTypeId. The field used to determine the RecordTypeId is CampaignMemberRecordTypeId and it is present on Campaign Object. I came across a scenario some time back where I could not use Workflow to update the RecordTyepId on CampaignMember. So, I ended up writing an Apex trigger that updates the CampaignMemberRecordTypeId field present on Campaign object.

Related Topic