function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
-_--_- 

Help w/ creating a custom 'add to campaign' button on the Lead tab

Hi All,

I am looking to add some pre-validation for which Leads acn be added to a campaigns from the Leads Tab via the 'Add to Campaign' button.

I didn't see any way to really perform this validation outside of a JS button that first performs the validation needed on the Leads selected and then assuming everything checks out, passes the list of leads into the regular 'Add to Campaign' flow.

My trouble comes from understanding how to invoke the existing 'Add to Campaign' functionality, inspecting the element didn't seem to help much either.

Has anyone attempted this in the past and has any advice on how I can invoke the 'Add to Campaign' functionality from a custom JS button?

Thanks to all who read and offer help!
-_--_-
Doing some further research on this topic, I realized I will have to create a new Action which I can tie to a lightning component.  This will help me perform my validations but one question still remains, how would I be able to invoke the standard "Mass Add to Campaign" functionality and pass in the list of valid records?

I still have not found how folks have been achieving this in the past or within lightning.

Thanks!