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
sparkorgsparkorg 

Trigger to Link a lead to a campaign

Hello,

 

I am very new to Apex and I need some serious help in creating a trigger

 

The main objective of the trigger is as follows:

The trigger must link leads to a particular campaign ( a common single campaign ) based on the leads "Hub score". The hub score can vary from 0 to any maximum value. Hence when the lead has a 0 value no campaign is generated for that particular lead, but if the lead had any hub score (any value from 1 to Max) a campaign should be generated for that particular lead.

 

Thank you in advance,

 

Regards,

Angela

Eli Flores, SFDC DevEli Flores, SFDC Dev

Each lead should create it's own campaign or it should be a campaign member of a single campaign? You seem to suggest one way in the first sentence and then a totally different requirement in the 2nd. 

sparkorgsparkorg

Sorry about the confusion ,

I meant "it should be a campaign member of a single campaign' and if the lead has a hubscore of "0" then no campaign shout be generated for that particular lead.