Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
APEX Configuration
In order to customize the Promotion Save process in
APEX layer, you must introduce a callable APEX class as a customization hook.
In order to setup the hook, go to Setup → Custom Metadata Types → CGCloud
Process Customization , and add the following records:
- Label: TPM_Promotion_Save
- DeveloperName: TPM_Promotion_Save
- Class: <Your Callable APEX Class>
- Enabled: checked
- Method: save
- APEX class structure
-
1global class <Your Callable APEX Class> implements System.Callable { 2 3 global Object call(String action, Map<String, Object> args) { 4 // Get the TPM_Promotion instance from the arguments 5 TPM_Promotion promotion = (TPM_Promotion) args.get('promotion'); 6 // Retrieve your custom state sent to UI 7 String payload = (String) args.get('customState'); 8 // Read Transaction Id 9 String txId = (String) args.get('txId'); 10 11 // Your custom logic goes here 12 } 13}
The call method is called during the Promotion Save
Process. At this method, you can add your customizations to the process:
- Create additional records
- Modify TPM records