Newer Version Available

This content describes an older version of this product. View Latest

TPM_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.

The content in this Consumer Goods Cloud Trade Promotion Management documentation is confidential and may be viewed only by customers or partners as authorized by Salesforce, and copying and further distribution is prohibited without prior written consent from Salesforce. The content is the highly confidential and proprietary information of Salesforce and is protected under the confidentiality obligations of your Agreement with Salesforce. Accordingly, the content may be used only as necessary in order to implement the Consumer Goods Cloud Trade Promotion Management functionality.

The content in this documentation is being released as a preview, and is not generally available and may contain errors. Salesforce is providing this documentation as-is, and makes no representations or warranties as to the accuracy of the content contained in this documentation. Salesforce reserves the right to update and revise this documentation, and content describing features of Consumer Goods Cloud Trade Promotion Management may be modified, added, or removed. If Salesforce distributes or releases updated versions of this documentation, you acknowledge and agree that you will delete and destroy any prior versions of this documentation.

Important

Namespace

1cgcloud

Example 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());

TPM_Promotion.DoWork Methods

The following are methods for TPM_Promotion.DoWork.

doWork

Use this interface to append work to be executed after the Promotion and it’s related records are committed to the database.

API Version

55

Signature

global void doWork()