Download page Creating an Apex Trigger for a Custom Object as a Step.
Creating an Apex Trigger for a Custom Object as a Step
A trigger is Apex code that executes before or after specific data manipulation language (DML) events occur, such as before object records are inserted into the database, or after records have been deleted. A list of all triggers in your organization is located in Setup under Apex Triggers. You can invoke Apex through the use of triggers. Apex triggers are stored as metadata in the application under the object with which they are associated.
A trigger is Apex code that executes before or after the following types of operations:
Insert.
Update.
Delete.
Merge.
Upsert.
Undelete.
In order for Conga Orchestrate to use a custom object you've created, you need to create a trigger and test class in a sandbox environment and deploy them to your production environment. Salesforce does not allow you to create an apex trigger or apex class directly in a production org. Refer to the Deploy from Sandbox with Change Sets for instructions on the deployment process.
Follow these steps to create the trigger in a sandbox environment:
In your sandbox environment, select the Settings Cog icon (in Lightning) or your name (in Classic) in the upper right corner of Salesforce.
Select Developer Console.
Select File.
Hover over New and choose Apex Trigger.
Give your trigger a descriptive name. Something like CustomObjectNameAsStepTrigger.
Choose the custom object from the sObject dropdown.
Select Submit.
Copy/Paste the following code into the new trigger window:
trigger TRIGGERNAME on YOUR_CUSTOM_OBJECT_API_NAME (after insert, before insert, before update, after update, before delete, after delete, after undelete) { FSTR.COTriggerHandler.handleOrchestrateTrigger();}
CODE
Replace the TRIGGERNAME in line 1 with the name of your new trigger. This will be the name you chose in step 5 above.
Replace YOUR_CUSTOM_OBJECT_API_NAME with the API name of your custom object.
Save the trigger by pressing Ctrl+S on your keyboard or by selecting File > Save in the top menu of the Developer Console.
Close the Developer Console window.
Ensure the correct configuration exists for your step or process object on theConga Orchestrate Objectcustom setting. This setting dictates whether the object is used as a process, step, or as both, by Conga Orchestrate.