Customize the Promotion Transfer Process
To modify the promotion details 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_PromotionTransfer>. TheRE_PromotionTransferclass exposes methods to access the promotion. For a list of all the exposed methods, see RE_PromotionTransfer Class Reference.
Here’s the Apex class structure.
-
To modify the promotion fields, use the methods exposed by the
RE_PromotionTransferclass.Add your customizations in the Apex class to:
- Create promotion records.
- Modify and delete existing promotion records.
Here’s a sample Apex class that adds a new promotion sObject record during the promotion save process.
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 in these details, and then save your work.
- Label:
RE_Promotion_Transfer_Save - DeveloperName:
RE_Promotion_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 existing promotion. Or it adds a promotion record based on your custom logic before transferring it to RE, where the promotion becomes sellable.
The transfer of custom attributes is supported only for advanced promotion, tactic, and tactic product objects.