1

I'm trying to run some custom code when I detect that a CampaignMemberStatus record has changed or been deleted and am having no real luck.

Cannot create APEX Trigger on CampaignMemberStatus (which would have been ideal)

I can create an APEX Trigger on CampaignMemberStatusChangeEvent, however the Update ChangeEvent is missing key information (Label) and with the Delete ChangeEvent I get the "old" record Id...and I don't know what to do with it.

Here's what is showing in the Update ChangeEvent (the action I took in the UI is simply to rename the status's Label):

{
    Id=1CExx0000001RKFGA2, 
    ReplayId=343371, 
    ChangeEventHeader=eventbus.ChangeEventHeader[
        getChangedFields=(LastModifiedDate);
        getChangeOrigin=com/salesforce/api/soap/51.0;
        client=SfdcInternalAPI/;
        getChangeType=UPDATE;
        getCommitNumber=10762862893734;
        getCommitTimestamp=1622750489000;
        getCommitUser=00554000008FZUYAA4;
        getDiffFields=();
        getEntityName=CampaignMemberStatus;
        getNulledFields=();
        getRecordIds=(01Y54000000fSs4EAE);
        getSequenceNumber=1;
        getTransactionKey=0005501e-75a3-182f-db68-de750acf5df3;
    ], 
    CampaignId=null, 
    SortOrder=null, 
    IsDefault=false, 
    HasResponded=false, 
    CreatedDate=null, 
    CreatedById=null, 
    LastModifiedDate=2021-06-03 20:01:29, 
    LastModifiedById=null
}

Is there something I'm missing to have "all" fields in the event? Any suggestions on getting meaningful info from a Delete (I would love to either get Label OR CampaignId)?

0

You must log in to answer this question.

Browse other questions tagged .