top of page
  • Writer's pictureVindhya Rani

Fire Journey through Salesforce Trigger

Are you facing a problem with your Journey not been executed through Salesforce DML Operations? No problem!!


Lets try executing the Journey without 'Salesforce Data' entry criteria replacing with API event executed from the Apex trigger.


We dont need to worry about our connectivity or Type of Ord or Permission issues.

Just need to copy paste the below code in Salesforce and need to make a minor changes.


Step 1: Find your ClientId and Client Secret from your Marketing Cloud Instance.

Goto Setup.

Goto Platform tools

Under Apps, Click Installed packages(Hope package is installed already else please do it)

Select for your right package and find your Client Id and Client Secret.


Find Client Id and Client secret

Step 2: Replace your 'Salesforce Data' Entry to 'API Entry event'.

Copy the EventDefinitionKey as shown below.


Find the Event definition key

Step 3: Copy paste the below Trigger and Apex class in your Salesforce instance and make the Object and field changes as per your requirement and Done!!!!!


Apex Trigger:

https://github.com/bhanuatsfdc/SFDCTriggerforJourney/blob/master/TriggerToFireJourney.trigger

Trigger on any Salesforce Object on which journey needs to be fired

Apex Class:

https://github.com/bhanuatsfdc/SFDCTriggerforJourney/blob/master/FiringJourneyTriggerClass

Helper class for the Trigger

After create or update operation on the Salesforce Object will trigger the Journey event.


538 views1 comment

Recent Posts

See All
bottom of page