Newer Version Available

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

Promotion and Tactic Transfer Customization Use Cases

This section provides different Apex customization use cases for the promotion and tactic transfer process.

Change a managed package sObject field value

Here’s a sample Apex class that modifies the date field of a tactic.

Here’s a sample Apex class that modifies the slogan field of a promotion.

Delete a managed package sObject record

Here’s a sample Apex class that deletes the first tactic from the list of tactics.

Here’s a sample Apex class that deletes the first promotion from the list of promotions.

Add a custom sObject

Here’s a sample Apex class that adds additional tactic sObject records to a planned promotion that is saved.

Here’s a sample Apex class that adds a promotion sObject record during the promotion save process.

The TPM_Promotion class ensures that all the promotion-related sObjects are committed in an all-or-none fashion while encapsulating all operations in a transaction.

Note

Get the tactic products linked to a tactic, and perform customization on the tactic products

Here’s a sample Apex class that gets all the products linked to a tactic and deletes the first product in the list.

Add new tactic products to the existing managed package or new tactic records

Here’s a sample Apex class that adds a product to a specific tactic.