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.
Promotion.DoWork Class
This APEX interface provides the capability to perform additional work once a promotion
is completed and the related records are committed to the database. The transaction will be rolled
back if there any any errors reported during the doWork execution.
Namespace
1cgcloudExample Implementation
1global class MyAfterCommitWork implements cgcloud.TPM_Promotion.DoWork {
2
3 // This method will be called after the promotion and related record
4 // changes are committed to the database.
5 // If any error is thrown during the execution of doWork, the transaction
6 // will be rolled back
7 global override void doWork() {
8 system.debug('Im here!');
9 }
10}
11
12
13
14cgcloud.TPM_Promotion tpmPromotion;
15
16// Register the work to be performed after the commit
17tpmPromotion.registerWork(new MyAfterCommitWork());