2

Our business does live events every weekend and we use Salesforce Campaigns to track prospects and mark attendees.

Right now, for each campaign, we get two campaign member status, "Sent" & "Responded". For each campaign we run, we also need "Attended".

Right now we have no viable solution but to go into each campaign and add that option through Advance Setup. But it gets very time consuming, when each event has 14+ campaigns etc.

Was wondering if anyone has any custom development work around or any ideas on how to automate the process. Could be through workflows or custom coding, anything helps!

1 Answer 1

1

There are multiple options with customization, but here's what I found based on my research which will eliminate the hassle for you:

https://sites.secure.force.com/appexchange/listingDetail?listingId=a0N30000005utCcEAI

above is appExchange app which works smooth for the same requirement, also following is suggestions for customization:

https://developer.salesforce.com/forums?id=906F00000008xrpIAA

Also Salesforce has considered making this as standard function which is under their future roadmap on which you can vote and help to get delivered soon:

https://success.salesforce.com/ideaview?id=08730000000Br5dAAC

And last but not least, I have code structure for this solution:

    trigger autoCampaignMemberStatusTrigger on Campaign (after insert) {

    List<Campaign> newCamps = [select Id from Campaign where Id IN :trigger.new AND ParentID = Null AND Campaign_Template__c=false];
    List<CampaignMemberStatus> cms = new List<CampaignMemberStatus>();
    Set<Id> camps = new Set<Id>();
    List<CampaignMemberStatus> cms2Insert = new List<CampaignMemberStatus>();

    for(Campaign camp : newCamps){

            camps.add(camp.Id);
    }   


    for(CampaignMemberStatus cm : [select Id, Label, CampaignId from CampaignMemberStatus where CampaignId IN :camps]) {


            CampaignMemberStatus cms1 = new CampaignMemberStatus(CampaignId = cm.CampaignId, HasResponded=false,
             Label = 'Email Sent', SortOrder = 3, isDefault = true);
             cms2Insert.add(cms1);          

            CampaignMemberStatus cms2 = new CampaignMemberStatus(CampaignId = cm.CampaignId, HasResponded=false,
             Label = 'Called', SortOrder = 4);
             cms2Insert.add(cms2);

            CampaignMemberStatus cms3 = new CampaignMemberStatus(CampaignId = cm.CampaignId, HasResponded=true,
             Label = 'Appointment Set', SortOrder = 5);
             cms2Insert.add(cms3); 

    }


    insert cms2Insert;
}

You must log in to answer this question.

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