6

I have thousand of campaigns for which I have to define campaign member statuses. Manually I know it is done via the advanced configuration on the campaign itself. But I don't think it feasible to manually update thousands of campaigns like this. I don't see options to do it via dataloader nor Apex code.

Does anyone know how to do it?

2 Answers 2

5

I do not see any problem to change it with Apex using CampaignMemberStatus standard object. You should have an campaign ID for that:

CampaignMemberStatus ms = new CampaignMemberStatus();
ms.CampaignId = '701E0000000K21v';
ms.Label = 'New Status';
ms.SortOrder = 5;
insert ms;
2
  • 2
    got it to work :) things that need to bear in mind is that the user updating this via dataloader should be a marketing user, and even in apex code , it should have the marketing user enabled. also the sort order should not coincede with existing one, else an error is generated
    – vanessen
    Commented Mar 18, 2016 at 12:08
  • @vanessen You are welcome! Commented Mar 18, 2016 at 12:08
2

Here is the table campaignMemberStatus and fields you can update. It is available via data loader (I can't remember but you may need to allow all objects). It is also available in apex and treated just like any other object.

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .