+ Start a Discussion
giri rocksgiri rocks 

Campaign Member from Checkbox Trigger

Campaign Member from Checkbox Trigger


Use case:

We have situations where we manage what communications someone gets based on a checkbox on their record in salesforce. Each checkbox will correspond to a campaign in Salesforce. When the value of that checkbox on the record is edited, we would like the status of that checkbox to create/delete a corresponding Campaign Member. As this is something we have multiple uses for, we would like it to be done in a way that we can tweak to re-purpose as needed.

Desired design:

- The trigger should be set up to allow us to specify one or more custom checkbox fields that trigger campaign member creation. For each checkbox we will be able to specify the corresponding campaign.
- The campaign that the campaign member will be created on should be easily specifiable in the trigger code (for example, by UID).
- The campaign member should be created with the default status
- The code delivered should include (a) a version for contacts and (b) a version that will work for leads.

Acceptance criteria:


- The trigger will add one (and only one) campaign member per contact record that is edited to check a checkbox field
- The trigger will remove only the corresponding campaign member for a contact record where the checkbox is unchecked and saved
- Needs to have test coverage required by salesforce for deploying to production
- The code should have comments where reasonable to help in understanding and reusing
- The trigger needs to be able to be extended to manage multiple checkbox-to-campaign pairings in one trigger (ie 3 checkboxes that correspond to 3 different campaigns)

giri rocksgiri rocks

need help plz help .........urgent

jkucerajkucera

Are you asking that somone write your code for you?  You might want to hire a developer to implement this.

jpb@uhcjpb@uhc

Did you ever get this developed we're looking to do somethine very similiar and would love to see some sample code.