Customize the Tactic Transfer Process
To modify the tactic details related to the promotion being transferred, create a callable Apex class as a customization hook.
-
Log in to your Salesforce org, and go to Developer Console.
-
Create a global Apex class that implements the
System.Callableinterface. -
Override the global
callmethod that has these parameters.action: String. The behavior for the method to exhibit..params: Map<String,Object>. Arguments to be used by the specified action. The object is of type List<RE_TacticTransfer>. TheRE_TacticTransferclass exposes methods to access the promotion and its tactic or tactic products. For a list of all the exposed methods, see RE_TacticTransfer Class Reference.
Here’s the Apex class structure.
-
To modify the tactic or tactic product fields, use the methods exposed by the
RE_TacticTransferclass.Add your customizations in the Apex class to:
- Create additional tactic records.
- Modify and delete existing tactic records.
Here’s a sample Apex class that adds additional tactic sObject records to a planned promotion that’s saved.
For use cases related to the promotion and tactic transfer process customization, see Promotion and Tactic Transfer Customization Use Cases.
-
From Setup, in the Quick Find box, enter
Custom Metadata Types, and then expand Custom Metadata Types. -
On the CGCloud Process Customization row, click Manage Records.
-
Click New, fill the following details, and then save your work.
- Label:
RE_Tactic_Transfer_Save - DeveloperName:
RE_Tactic_Transfer_Save - Class:
<Your Callable APEX Class> - Method:
save - Enabled: Select the checkbox.
- Label:
The Apex customization hook is enabled. When a planned promotion is saved in TPM, the call method modifies the tactic or tactic product details related to the promotion based on your custom logic before transferring it to RE.