---
schema_version: "1"
id: f0d0794b53dd570399c291763139f3f0fe4b308d34bc946822b84e22144089b1
title: Promotion
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/retail_api/promotion.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/promotion.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 8c22e575ccfafd07d26987dae701a7555c985cc2c451c4262991fac8dd64dd4c
description: This section provides information about promotion..
---
# Promotion

This section provides information about promotion..

## loadPromotionDefaults2

- Description: Loads promotion values. If the Input Id matches and existing promotion by Id or by External Id, the Promotion will be loaded. If not, a new promotion will be created.
- Classname: Promotion2BoApiCoreWorkflowSteps
- Method: loadPromotionDefaults

Table 1. Input Properties
| Property | Description | Required or Optional |
| --- | --- | --- |
| .Id | SFDC Id or External Id for the Promotion. | Optional |
| .PromotionTemplate | Promotion Template Name or SFDC Id of the Promotion Template | Required |

## **setPromotionAnchor2**

- Description: Sets the Promotion Anchor (Account, Account Set or null) depending on the template
- Classname: Promotion2BoApiCoreWorkflowSteps
- Method: setPromotionAnchor

Table 2. Input Properties
| Property | Description | Required or Optional |
| --- | --- | --- |
| .AnchorAccount | SFDC Id or External Id for the customer. | Optional |
| .AnchorAccountSet | SFDC Id or Name for the customer set. | Optional |

## **setPromotionDates2**

- Description: Sets the dates (from/thru, commit, placement, order, delivery for a promotion)
- Classname: Promotion2BoApiCoreWorkflowSteps
- Method: setPromotionDates

Table 3. Input Properties
| Property | Description | Required or Optional |
| --- | --- | --- |
| .DateFrom | Start date. | Optional |
| .DateThru | Start and end date. | Optional |
| .CommitDate | Commit date. | Optional |
| .PlacementDateFrom | Placement start date. | Optional |
| .PlacementDateThru | Placement start and end date. | Optional |
| .OrderDateFrom | Order start date. | Optional |
| .OrderDateThru | Order start and end date. | Optional |
| .DeliveryDateFrom | Delivery start date. | Optional |
| .DeliveryDateThru | Delivery start and end date. | Optional |

This workflow step sets the dates for a promotion. It maps the following Simple Promotion JSON properties to their equivalents on the Promotion Object.

DateFrom => Date\_From\_\_c
DateThru => Date\_Thru\_\_c
CommitDate => Commit\_Date\_\_c
PlacementDateFrom => Placement\_Date\_From\_\_c
PlacementDateThru => Placement\_Date\_Thru\_\_c
OrderDateFrom => Order\_Date\_From\_\_c
OrderDateThru => Order\_Date\_Thru\_\_c
DeliveryDateFrom => Delivery\_Date\_From\_\_c
DeliveryDateThru => Delivery\_Date\_Thru\_\_c

It has 2 different cases:

- On New Promotion
    - DateFrom and DateThru are required. If they're missing, raise an exception.
    - If any of the other properties is missing, the value from it's equivalent in the DateFrom/DateThru will be used instead
- On Update Promotion
    - If any of the other properties is not provided, the original value remains untouched.

## **applyPromotionDateHandling2**

- Description: Applies automatic date handling rules to new promotions. must be executed after setPromotionDates rule.
- Classname: Promotion2BoApiCoreWorkflowSteps
- Method: applyPromotionDateHandling

This rule must run after setPromotionDates rule.

## **setPromotionCategories2**

- Description: Sets the promotion categories.
- Classname: Promotion2BoApiCoreWorkflowSteps
- Method: setPromotionCategories

## **setPromotionSubAccounts2**

- Description: Sets the promotion default sub accounts.
- Classname: Promotion2BoApiCoreWorkflowSteps
- Method: setPromotionSubAccounts

This workflow step sets the Sub Account information for the promotion. On a new Promotion, it checks for the Sub\_Accounts\_Enabled\_\_c flag of the template. If set, set the SubAccounts selection using the methods of the Promotion Factory class:

## **setPromotionParticipatingCustomers2**

- Description: Sets the promotion default participating customers list.
- Classname: Promotion2BoApiCoreWorkflowSteps
- Method: setPromotionParticipatingCustomers

This workflow step sets the Participating Customer information for the promotion. On a new Promotion, it checks for the Is\_Pushable\_\_c flag of the template.