Core Business Object API Rule Definitions
Trade Promotion Management includes some methods that are used to create Business Object (BO) API Workflow Steps. These steps are used to create the output JSON that's used during BO API Transaction creation and mass-copy promotion.
Required Editions
Available in: Lightning Experience Available in: Enterprise and Unlimited Editions where Consumer Goods Cloud is enabled |
Generic Method
This method belongs to the PromotionBoApiCoreWorkflowSteps class.
| Method | Description | ||||||
|---|---|---|---|---|---|---|---|
| mapValues |
Maps values from the input to the output structure without any processing. The method can be used to map promotion values (mapPromotionValues) and tactic values (mapTacticValues). The method reads the value of the Maps To field and maps the field to the output fields. For instance, CG_Slogan_Language_1__c is an output field that's used to set the slogan for a promotion. The input properties of this method depend on the entity for which you use this method.
|
Promotion Methods
These methods belong to the PromotionBoApiCoreWorkflowSteps class.
| Method | Description |
|---|---|
| loadPromotionDefaults |
Loads promotion values. Based on the input, the method can load promotions in these ways:
Note
|
| setPromotionAnchor |
Checks the value of the promotion anchor. Depending on the anchor type of the promotion template, the promotion anchor can be customer, customer set, or null.
|
| setPromotionDates |
Sets the promotion dates (Date From, Date Thru, commit date, in-store dates, order dates, and shipment dates). The input properties are:
During promotion creation, the Date From and Date Thru of a promotion are mandatory inputs. The system raises an exception if these inputs are missing. |
| applyPromotionDateHandling | Applies automatic promotion date handling rules to new promotions. The method updates
the promotion and tactic periods based on the Timeframe Determination Policy of the
promotion, and is applicable only when the timeframe determination policy is set to Automatic
Simple. Note You need the in-store dates of the promotion to apply the automatic promotion
date handling rules. Run applyPromotionDateHandling after setPromotionDates. To achieve
this, when adding Business Object API Workflow Steps to the Business Object API Workflows,
the workflow step that uses applyPromotionDateHandling is assigned a higher sort value
compared to the one using setPromotionDates. |
| setPromotionCategories | Sets the promotion categories. During promotion creation, the system reads all the categories the user has access to, and adds a new entry with proper categories in the output JSON. When a promotion is created or updated, the system generates new records on promotion product share to store the categories to which the user has access. |
| setPromotionSubAccounts | Takes the sub accounts associated with the anchor customer of the promotion and
places the sub accounts in the promotion. If the Sub Accounts Enabled option is set to True, this method sets the information of the sub accounts in the promotion. |
| setPromotionParticipatingCustomers |
Sets the participating customer information for a promotion. If the Pushable option is set to True, this method sets the values of the Aggregation Category and Push Target Account Selection fields of the promotion. These fields aren’t visible on the UI. |
BOPromotion Methods
These methods belong to the PromotionBoApiCopyCoreWorkflowSteps class.
| Method | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| loadPromotionBOForCopy |
Loads the promotion business object and copies the object's properties into the output object while mass copying promotions. The mandatory input property of this method is .Id, which refers to the promotion’s Salesforce ID or external ID. The system raises an exception if the promotion isn’t found or if the copyable option of the promotion template is set to False. |
||||||||||||
| loadPromotionAttachmentsForCopy |
Loads the promotion attachments while mass copying promotions. The input properties of this method are:
Note This method is applicable only if the .CopyAttachments property is set to True. |
||||||||||||
| loadCategoryShareLO | Loads the details of category sharing for a promotion while mass copying
promotions. The mandatory input property of this method is .Id, which refers to the promotion’s Salesforce ID or external ID. The system raises an exception if the promotion isn’t found. This method is run based on this logic:
|
||||||||||||
| resetPromotion |
Resets the promotion structure to insert as a new one. This method sets the values of these output fields:
|
||||||||||||
| movePromotionTimeframe |
Advances the promotion dates by the specified number of years. This method is used during mass copy of promotions to set the values of these promotion and tactic dates:
The optional input property of this method, .AddYears, determines the number of years by which to move the promotion dates. This method sets the promotion dates based on the offset defined in this input property and calculates the offset years based on the value of the Mass Copy Start Date option. Note If the .AddYears property isn't set, the promotion dates are advanced by one
year. After the dates are changed, the system validates that the selected customer or customer set is valid for the new promotion period. |
||||||||||||
| managePromotionProductFilterCopy |
Filters the product filter criteria by removing products that are no longer valid for the promotion period. This method is used during mass copy of promotions. This method sets the output based on this logic:
|
||||||||||||
| manageParticipatingCustomersCopy |
Identifies and removes invalid customers from the list of participating customers in the target promotion period during mass copy of promotions. If the promotion template isn’t pushable, this method sets the Promotion Push Target Account Selection field to empty. This field isn’t visible on the UI. Otherwise, for each participating customer, the method evaluates these criteria:
The system classifies the customers that don’t meet any of these criteria as invalid customers and removes them from the list of participating customers. Note For all valid customers, the system copies the Included option from the source
promotion to target promotions. |
||||||||||||
| manageSubAccountsCopy |
Identifies and removes invalid sub accounts from the list of sub accounts in the target promotion time frame during mass copy of promotions. This method sets the output based on this logic:
|
||||||||||||
| manageManualInputCopy |
Manages manual inputs during mass copy of promotions. This method sets the output based on this logic:
Copies the manual input relevant for the nth week or period of the source promotion to the nth week or period of the target promotion. If the source promotion has a greater number of weeks or periods than the target promotion, the manual inputs of extra weeks or periods of the source promotion are lost. But if the source promotion has a lesser number of weeks or periods than the target promotion, then no values are copied to the extra weeks or periods of the target promotion. |
Tactic Methods
These methods belong to the PromotionBoApiCoreWorkflowSteps class.
| Method | Description | ||||||
|---|---|---|---|---|---|---|---|
|
loadTacticDefaults |
Loads tactic values during tactic creation and update. Based on the input, the method can load tactics in these ways:
This method also sets the value of the product filters as the output in this manner:
Note
|
||||||
|
setTacticDates |
Sets the tactic dates (Date From, Date Thru, instore, and shipment) when a tactic is created or updated. The input properties of this method are:
During tactic creation, if no values exist in the input, the equivalent values are copied from the promotion. During tactic update, the missing values remain untouched. |
LOTactic Methods
These methods belong to the PromotionBoApiCopyCoreWorkflowSteps class.
| Method | Description |
|---|---|
| loadTacticsLOForCopy |
Loads the promotion tactic list while mass copying promotions. The method removes all the tactic records with an inactive tactic template. The mandatory input property is .Id, which refers to the promotion’s Salesforce ID or external ID. The system raises an exception if the promotion isn’t found. Note This method is applicable only if the relevant promotion template includes tactics as a
part of the Copied Components. |
| resetTactic |
Resets the tactic structure to insert the structure as new. The method sets the values of these output fields:
|
| manageTCCDsLOForCopy |
Copies the Tactic Condition Creation Definition (TCCD) records from the source promotion tactics to the target promotion tactics. The method uses the current BO Promotion output JSON as the input to retrieve the details of relevant tactics and fetch the related TCCD records. Note
|
| manageTacticProductFilterCopy |
Filters the product criteria by removing products that are no longer valid for the promotion period while mass copying promotions. This method sets the output based on this logic:
|
Product Method
This method belongs to the PromotionBoApiCoreWorkflowSteps class.
| Method | Description |
|---|---|
| setProductFilter |
Sets the product filter criteria provided in the input to the promotion’s filter criteria value. Note Provide the filter criteria at the promotion level in the input JSON. You can’t add
products individually to tactics. The input properties of this method are:
Each input property accepts only string values with a maximum of 40 characters. The Maps To field includes the name of the field on which the filter criteria is set. Each criteria property is mapped to the Salesforce object field that represents it. For instance, the .Criteria.Brand [*] property is mapped to the Brand__c field in the core application as: ".Criteria.Brand[*]" => "brand__c" Projects can map their own customized fields to each property. Note
In the product filter criteria, when you add multiple categories, include at least one brand corresponding to each category for the selection to be valid. When you add multiple categories and one or more brands of one category and no brand of the other category, the category for which no brands are included is ignored by the system and not included in the promotion. To avoid this, include all the brands of each product category in the input. |
Manual Input Method
This method belongs to the PromotionBoApiCoreWorkflowSteps class.
| Method | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| handleManualInputs |
Handles the list of manual inputs provided by the user at product, component, promotion, or tactic total level. The input properties of this method are:
When the BOM Scope of the input KPI contains Component, the system sets the KPI value as the total value of the corresponding product, component, promotion, or tactic in this manner:
Depending on whether Scenario Planning is enabled, these options are possible:
Note The system validates these conditions on the input parameters and raises exceptions if
the conditions aren’t met:
|
Tactic Condition Creation Definition Method
This method belongs to the PromotionBoApiCoreWorkflowSteps class.
| Method | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| SetTacticConditionCreationDefinitions | Creates Tactic Condition Creation Definition (TCCD) records when a new promotion is
created and updates TCCD records when a promotion is updated. The input properties of this method are:
Note
This table lists the different scenarios that the system can encounter:
Note Run the mapTacticValues method before this method. Ensure that the sort value of this
method is greater than the sort value of the mapTacticValues method. |

