Newer Version Available

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

TPM_Scenarios Class

This APEX class provides programmatic access to the TPM Promotion Scenario information used in the Promotion. Scenarios define selectable sets of Promotion Level Manual Inputs overrides to simulate different combinations of active/inactive tactics and KPI overrides in a TPM Promotion. A TPM_Scenarios structure can contain up to five scenarios information.

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

TPM_Scenarios Methods

The following are methods for TPM_Scenarios.

global ScenarioParameter addScenarioParameter

Index must be an scenario index between 1 and 5 (included) Adds a parameter to the scenario parameters of the selected scenario. The required attributes are the scenario index, the KPI Name to set (must be a Scenario KPI defined on the Promotion Template), the numeric value of the KPI and if the parameter is already applied (If applied, UI will not re-apply the value when loading the scenario information. If not applied, when loading the scenario, UI will apply the value of the parameter to the total of the KPI) .

API Version

55

Signature

global ScenarioParameter addScenarioParameter(Integer scenarioIdx, String kpiName, Decimal value, Boolean applied)

global List<ScenarioParameter> getScenarioParameters

Index must be an scenario index between 1 and 5 (included) Returns all the scenario parameters for the selected scenario.

API Version

55

Signature

global List<ScenarioParameter> getScenarioParameters(Integer scenarioIdx)

global Map<String, Object> toGenericObject

Serializes the scenarios information into a generic object. Useful for usage on remote calls.

API Version

55

Signature

global Map<String, Object> toGenericObject()

global Object toGenericObjectParameters

Index must be an scenario index between 1 and 5 (included) Serializes the parameters information for the selected scenario into a generic object. Useful for usage on remote calls.

API Version

55

Signature

global Object toGenericObjectParameters(Integer idx)

global Object toGenericObjectManualInputs

Index must be an scenario index between 1 and 5 (included) Serializes the manual inputs information for the selected scenario into a generic object. Useful for usage on remote calls.

API Version

55

Signature

global Object toGenericObjectManualInputs(Integer idx)

global TPM_Scenarios load

Loads the serialized scenarios information into the current instance. The current instance will be cleared and the scenarios represented by the payload will be loaded.

API Version

55

Signature

global TPM_Scenarios load(String payload)

global String toJSONParameters

Index must be an scenario index between 1 and 5 (included) Serializes the parameters information for the selected scenario into a String used for storage.

API Version

55

Signature

global String toJSONParameters(Integer idx)

global String toJSON

Serializes the scenarios information into a Sstring used for storage.

API Version

55

Signature

global String toJSON()

global String toJSONManualInputs

Index must be an scenario index between 1 and 5 (included) Serializes the manual inputs information for the selected scenario into a String used for storage.

API Version

55

Signature

global String toJSONManualInputs(Integer idx)

global TPM_Scenarios

Creates an empty scenario sctructure.

API Version

55

Signature

global TPM_Scenarios()

global TPM_Scenarios load

Loads the scenarios information from the parameter generic object. The current instance will be cleared and the scenarios represented by the payload will be loaded.

API Version

55

Signature

global TPM_Scenarios load(Object data)

global TPM_Scenarios setScenarioManualInputs

Index must be an scenario index between 1 and 5 (included) Sets the parameter manual inputs as manual inputs for the selected scenario.

API Version

55

Signature

global TPM_Scenarios setScenarioManualInputs(Integer scenarioIdx, TPM_ManualInputs manualInputs)

global TPM_ManualInputs getScenarioManualInputs

Index must be an scenario index between 1 and 5 (included) Returns the manual inputs for the selected scenario.

API Version

55

Signature

global TPM_ManualInputs getScenarioManualInputs(Integer scenarioIdx)

global void clear

Removes all information for the five possible scenarios.

API Version

55

Signature

global void clear()

global void removeScenarioParameter

Index must be an scenario index between 1 and 5 (included) Removes the passed in scenario parameter from the parameters of the selected scenario. If the ScenarioParameter is not part of the scenario, nothing is removed.

API Version

55

Signature

global void removeScenarioParameter(Integer scenarioIdx, ScenarioParameter param)