0

We have a special use case where we want to add campaign members automatically to a parent campaign (if there is a parent campaign).
In practice, if someone adds a lead / contact to a campaign an appropriate campaign member in the parent campaign should be created.
But this should only happen if the child campaign has a certain state (boolean flag).
So I guess I have to check the campaign state in the "after insert trigger" of the campaign member insert operation.
What would be the best way to check the state of the campaign while in the campaign member (after) insert trigger?
Is this possible without a campaign query?

1

In order to do that without a campaign query, you can have a formula field on the Campaign Member that checks the campaign state. Formula fields will be available on your trigger.

Also, you'll probably want to work on the after trigger

  • Thanks! Yes right, it should be the after trigger. Would you recommend a query or a formula field? – Detached Nov 9 '16 at 8:38
  • 1
    I'd go with the formula field. It's a good practice to avoid unnecessary queries =D – Fernando Gavinho Nov 9 '16 at 8:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.