Newer Version Available

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

Promotion Wizards & Customization

Wizards related to promotions are implemented using Metadata Wizard and Business Object API.
When a user launches a wizard for a promotion, the MetadataWizard configuration for this user is used to display the required options in the user interface. When the user submits the wizard, the payload generated is submitted to the relevant Business Object API workflow for processing.
  • When new promotion option is selected from Trade Planning, Account Plan, or Promotion List, the NewPromotion configuration is used. When the wizard is submitted, the Create workflow is triggered through Business Object API.
  • When copy option is selected from Trade Planning or Promotion List, the CopyPromotion configuration is used. When the wizard is submitted, the Copy workflow is triggered through Business Object API.
  • When derive option is selected from Trade Planning or Promotion List, the DerivePromotion configuration is used. When the wizard is submitted, the Derive workflow is triggered through Business Object API.

Installing and Updating Base Configuration Records

To install or update base configuration records, execute the following commands in APEX console:cgcloud.TPMSetupData.setupMetadataWizard('<sales org>'); cgcloud.TPMSetupData.setupBOApi('<sales org>');

These commands create and update MetadataWizard configuration records and Business Object API configuration records to the provided values by Consumer Goods Cloud TPM for the salesorg.

Base MetadataWizard Configurations

NewPromotion
1{
2  "size": "medium",
3  "title": "{! $Label.cgcloud__NPW_NEW + ' ' + $SObjectType.cgcloud__Promotion__c.label}",
4  "columns": 2,
5  "components": [
6    {
7      "id": "promoSlogan",
8      "type": "Text",
9      "outputProperty": "Slogan",
10      "required": true,
11      "label": "{! $SObjectType.cgcloud__Promotion__c.fields.cgcloud__Slogan__c.label }",
12      "maxLength": 80,
13      "defaultValue": "{! _input_.Slogan }"
14    },
15    {
16      "id": "promoTemplate",
17      "type": "Picklist",
18      "required": true,
19      "outputProperty": "PromotionTemplate",
20      "source": {
21        "class": "NewPromotionWizardCallable",
22        "method": "getPromotionTemplates",
23        "cache": true,
24        "params": {}
25      },
26      "label": "{! $SObjectType.cgcloud__Promotion__c.fields.cgcloud__Promotion_Template__c.label }",
27      "autoSelectFirstItem": true,
28      "defaultValue": "{! _input_.PromotionTemplate}"
29    },
30    {
31      "id": "promoAnchorAccount",
32      "type": "Picklist",
33      "active": "{! promoTemplate.AnchorType == 'Customer' }",
34      "visible": "{! promoTemplate.AnchorType == 'Customer' }",
35      "required": true,
36      "outputProperty": "AnchorAccount",
37      "source": {
38        "class": "NewPromotionWizardCallable",
39        "method": "getAccounts",
40        "cache": true,
41        "params": {
42          "dateFrom": "{! promoDateFrom }",
43          "dateThru": "{! promoDateThru }"
44        }
45      },
46      "label": "{! $SObjectType.cgcloud__Promotion__c.fields.cgcloud__Anchor_Account__c.label }",
47      "autoSelectFirstItem": true,
48      "defaultValue": "{! _input_.AnchorAccount}"
49    },
50    {
51      "id": "promoAnchorAccountSet",
52      "type": "Picklist",
53      "active": "{! promoTemplate.AnchorType == 'CustomerSet' }",
54      "visible": "{! promoTemplate.AnchorType == 'CustomerSet' }",
55      "required": true,
56      "outputProperty": "AnchorAccountSet",
57      "source": {
58        "class": "NewPromotionWizardCallable",
59        "method": "getAccountSets",
60        "cache": true,
61        "params": {
62          "dateFrom": "{! promoDateFrom }",
63          "dateThru": "{! promoDateThru }"
64        }
65      },
66      "label": "{! $SObjectType.cgcloud__Promotion__c.fields.cgcloud__Anchor_Account_Set__c.label }",
67      "autoSelectFirstItem": true,
68      "defaultValue": "{! _input_.AnchorAccountSet }"
69    },
70    {
71      "id": "promoNoAnchor",
72      "type": "Empty",
73      "visible": "{! promoTemplate.AnchorType == null }"
74    },
75    {
76      "type": "Picklist",
77      "id": "productPicklist",
78      "label": "{! $SObjectType.Product2.fields.cgcloud__Criterion_3_Product__c.label }",
79      "active": "{! promoTemplate.ProductDefinitionLevel == 'Promotion' }",
80      "visible": "{! promoTemplate.ProductDefinitionLevel == 'Promotion' }",
81      "source": {
82        "class": "NewPromotionWizardCallable",
83        "method": "getProducts",
84        "params": {
85          "level": "Brand",
86          "dateFrom": "{! promoDateFrom }",
87          "dateThru": "{! promoDateThru }",
88          "promotionTemplate": "{! promoTemplate.Id }",
89          "accountOrAccountSet": "{! if(promoTemplate.AnchorType, if(promoTemplate.AnchorType == 'CustomerSet', promoAnchorAccountSet.Id, promoAnchorAccount.Id), '') }"
90        },
91        "cache": true
92      },
93      "multiselect": true,
94      "defaultValue": "{! _input_.criterion_3_product__c }",
95      "outputProperty": "ProductFilter.Criteria.Brand"
96    },
97    {
98      "id": "promoNoProduct",
99      "type": "Empty",
100      "visible": "{! promoTemplate.ProductDefinitionLevel != 'Promotion' }"
101    },
102    {
103      "id": "promoDateFrom",
104      "type": "Date",
105      "label": "{!$SObjectType.cgcloud__Promotion__c.fields.cgcloud__Placement_Date_From__c.label}",
106      "outputProperty": "DateFrom",
107      "required": true,
108      "defaultValue": "{! _input_.initialDate || 'today' }"
109    },
110    {
111      "id": "promoDateThru",
112      "type": "Duration",
113      "referenceDate": "{! promoDateFrom }",
114      "required": true,
115      "label": "{! $Label.cgcloud__NPW_DURATION }",
116      "outputProperty": "DateThru",
117      "defaultValue": {
118        "metric": "week",
119        "quantity": 3
120      }
121    },
122    {
123      "id": "promoManualInputController",
124      "type": "ListController",
125      "label": "{! $Label.cgcloud__NPW_KPI }",
126      "outputProperty": "ManualInputs",
127      "maxItems": "{! promoTemplate.NumberOfPromotionKPIs }",
128      "active": "{! promoTemplate.NumberOfPromotionKPIs }",
129      "defaultItems": "{! promoTemplate.NumberOfPromotionKPIs }",
130      "visible": "{! promoTemplate.NumberOfPromotionKPIs }",
131      "itemUniqueKey": "{! promoKPI.Id }",
132      "columns": 2,
133      "components": [
134        {
135          "id": "promoKPI",
136          "label": "{! $Label.cgcloud__NPW_KPI }",
137          "type": "Picklist",
138          "required": true,
139          "source": {
140            "class": "NewPromotionWizardCallable",
141            "method": "getPromotionKPIs",
142            "params": {
143              "promoTemplate": "{! promoTemplate.Id }"
144            },
145            "cache": true
146          },
147          "outputProperty": "KPI",
148          "autoSelectFirstItem": true,
149          "defaultValueIndex": "{! _idx_ }"
150        },
151        {
152          "id": "promoKPIValue",
153          "label": "{! $Label.cgcloud__VALUE}",
154          "type": "Number",
155          "required": true,
156          "outputProperty": "Value",
157          "decimalPlaces": "{! promoKPI.ValueDecimalPlaces }"
158        }
159      ]
160    },
161    {
162      "id": "TacticController",
163      "type": "ListController",
164      "label": "{! $SObjectType.cgcloud__Tactic__c.pluralLabel }",
165      "outputProperty": "Tactics",
166      "maxItems": 10,
167      "active": "{! promoTemplate.HasTacticTemplates }",
168      "visible": "{! promoTemplate.HasTacticTemplates }",
169      "defaultItems": 1,
170      "columns": 3,
171      "components": [
172        {
173          "id": "tacticTemplate",
174          "type": "Picklist",
175          "required": true,
176          "outputProperty": "TacticTemplate",
177          "source": {
178            "class": "NewPromotionWizardCallable",
179            "method": "getTacticTemplates",
180            "params": {
181              "promoTemplate": "{! promoTemplate.Id }"
182            },
183            "cache": true
184          },
185          "label": "{! $SObjectType.cgcloud__Tactic__c.fields.cgcloud__Tactic_Template__c.label }",
186          "defaultValueIndex": "{! _idx_ }",
187          "autoSelectFirstItem": true
188        },
189        {
190          "id": "tacticKPIValue",
191          "type": "Number",
192          "label": "{! tacticKPIName.Name }",
193          "required": false,
194          "outputProperty": "ManualInputs[0].Value",
195          "visible": "{! tacticKPIName.Id }",
196          "active": "{! tacticKPIValue != null || tacticKPIValue == 0 }",
197          "decimalPlaces": "{! tacticKPIName.ValueDecimalPlaces }"
198        },
199        {
200          "id": "tacticKPIName",
201          "type": "Picklist",
202          "label": "{! $Label.cgcloud__NPW_KPI }",
203          "visible": false,
204          "active": "{! tacticKPIValue != null || tacticKPIValue == 0 }",
205          "source": {
206            "class": "NewPromotionWizardCallable",
207            "method": "getTacticKPIs",
208            "params": {
209              "promoTemplate": "{! promoTemplate.Id }",
210              "tacticTemplate": "{! tacticTemplate.Id }"
211            },
212            "cache": true
213          },
214          "outputProperty": "ManualInputs[0].KPI",
215          "autoSelectFirstItem": true
216        },
217        {
218          "id": "tacticCompensationModel",
219          "type": "Picklist",
220          "required": true,
221          "outputProperty": "CompensationModel",
222          "source": {
223            "class": "NewPromotionWizardCallable",
224            "method": "getTacticCompensationModels",
225            "params": {
226              "tacticTemplate": "{! tacticTemplate.Id }"
227            },
228            "cache": true
229          },
230          "label": "{! $SObjectType.cgcloud__Tactic__c.fields.cgcloud__Compensation_Model__c.label }",
231          "autoSelectFirstItem": true
232        }
233      ]
234    }
235  ],
236  "footerLeftButtons": [
237    "cancel"
238  ],
239  "footerRightButtons": [
240    {
241      "type": "saveAndCopy",
242      "brand": "neutral",
243      "label": "{! $Label.cgcloud__NPW_BTN_SAVE_AND_COPY }"
244    },
245    {
246      "type": "saveAndEdit",
247      "brand": "neutral",
248      "label": "{! $Label.cgcloud__NPW_BTN_SAVE_AND_EDIT }"
249    },
250    {
251      "type": "submit",
252      "brand": "brand",
253      "label": "{! $Label.cgcloud__NPW_BTN_SAVE }"
254    }
255  ]
256}
CopyPromotion
1{
2  "size": "small",
3  "title": "{! $Label.cgcloud__PC_BTN_COPY + ' ' + $SObjectType.cgcloud__Promotion__c.label}",
4  "columns": 1,
5  "context": [
6    {
7      "id": "promotionData",
8      "source": {
9        "class": "CopyPromotionWizardCallable",
10        "method": "getPromotion",
11        "cache": false,
12        "params": {
13          "promotionId": "{! _input_.promotionId }",
14          "fields": [
15            "Id",
16            "cgcloud__Slogan__c",
17            "cgcloud__Placement_Date_From__c",
18            "cgcloud__Anchor_Account__c",
19            "cgcloud__Anchor_Account_Set__c",
20            "cgcloud__Promotion_Template__r.cgcloud__Anchor_Type__c"
21          ]
22        }
23      }
24    }
25  ],
26  "components": [
27    {
28      "id": "promotionId",
29      "type": "Computed",
30      "outputProperty": "Id",
31      "value": "{! promotionData.Id }"
32    },
33    {
34      "id": "promoSlogan",
35      "type": "Text",
36      "outputProperty": "Slogan",
37      "required": true,
38      "label": "{! $SObjectType.cgcloud__Promotion__c.fields.cgcloud__Slogan__c.label }",
39      "maxLength": 80,
40      "defaultValue": "{! promotionData.cgcloud__Slogan__c }"
41    },
42    {
43      "id": "promoDateFrom",
44      "type": "Date",
45      "label": "{!$SObjectType.cgcloud__Promotion__c.fields.cgcloud__Placement_Date_From__c.label}",
46      "outputProperty": "InStoreDateFrom",
47      "required": true,
48      "defaultValue": "{! promotionData.cgcloud__Placement_Date_From__c || 'today' }"
49    },
50    {
51      "id": "promoAnchorAccount",
52      "type": "Picklist",
53      "active": "{! promotionData.cgcloud__Promotion_Template__r.cgcloud__Anchor_Type__c == 'Customer' }",
54      "visible": "{! promotionData.cgcloud__Promotion_Template__r.cgcloud__Anchor_Type__c == 'Customer' }",
55      "outputProperty": "AnchorAccount",
56      "source": {
57        "class": "CopyPromotionWizardCallable",
58        "method": "getAccounts",
59        "cache": true,
60        "params": {
61          "promotionId": "{! promotionId }",
62          "inStoreDateFrom": "{! promoDateFrom }"
63        }
64      },
65      "label": "{! $SObjectType.cgcloud__Promotion__c.fields.cgcloud__Anchor_Account__c.label }",
66      "autoSelectFirstItem": true,
67      "defaultValue": "{! promotionData.cgcloud__Anchor_Account__c }"
68    },
69    {
70      "id": "promoAnchorAccountSet",
71      "type": "Picklist",
72      "active": "{! promotionData.cgcloud__Promotion_Template__r.cgcloud__Anchor_Type__c == 'CustomerSet' }",
73      "visible": "{! promotionData.cgcloud__Promotion_Template__r.cgcloud__Anchor_Type__c == 'CustomerSet' }",
74      "required": true,
75      "outputProperty": "AnchorAccountSet",
76      "source": {
77        "class": "CopyPromotionWizardCallable",
78        "method": "getAccountSets",
79        "cache": true,
80        "params": {
81          "promotionId": "{! promotionId }",
82          "inStoreDateFrom": "{! promoDateFrom }"
83        }
84      },
85      "label": "{! $SObjectType.cgcloud__Promotion__c.fields.cgcloud__Anchor_Account_Set__c.label }",
86      "autoSelectFirstItem": true,
87      "defaultValue": "{! promotionData.cgcloud__Anchor_Account_Set__c }"
88    },
89    {
90      "id": "promoNoAnchor",
91      "type": "Empty",
92      "visible": "{! promotionData.cgcloud__Promotion_Template__r.cgcloud__Anchor_Type__c == null }"
93    },
94    {
95      "id": "copyAttachments",
96      "type": "Checkbox",
97      "outputProperty": "CopyAttachments",
98      "label": "{! $Label.cgcloud__PC_LBL_COPY_ATTACHMENTS }"
99    }
100  ],
101  "footerLeftButtons": [
102    "cancel"
103  ],
104  "footerRightButtons": [
105    {
106      "type": "saveAndCopy",
107      "brand": "neutral",
108      "label": "{! $Label.cgcloud__NPW_BTN_SAVE_AND_COPY }"
109    },
110    {
111      "type": "saveAndEdit",
112      "brand": "neutral",
113      "label": "{! $Label.cgcloud__NPW_BTN_SAVE_AND_EDIT }"
114    },
115    {
116      "type": "submit",
117      "brand": "brand",
118      "label": "{! $Label.cgcloud__NPW_BTN_SAVE }"
119    }
120  ]
121}
DerivePromotion
1{
2  "size": "small",
3  "title": "{! $Label.cgcloud__PC_BTN_DERIVE + ' ' + $SObjectType.cgcloud__Promotion__c.label}",
4  "columns": 1,
5  "context": [
6    {
7      "id": "promotionData",
8      "source": {
9        "class": "CopyPromotionWizardCallable",
10        "method": "getPromotion",
11        "cache": false,
12        "params": {
13          "promotionId": "{! _input_.promotionId }",
14          "fields": [
15            "Id",
16            "cgcloud__Placement_Date_From__c"
17          ]
18        }
19      }
20    }
21  ],
22  "components": [
23    {
24      "id": "promotionId",
25      "type": "Computed",
26      "outputProperty": "Id",
27      "value": "{! promotionData.Id }"
28    },
29    {
30      "id": "promoTemplate",
31      "type": "Picklist",
32      "required": true,
33      "outputProperty": "PromotionTemplate",
34      "source": {
35        "class": "DerivePromotionWizardCallable",
36        "method": "getPromotionTemplates",
37        "cache": true,
38        "params": {
39          "promotionId": "{! promotionData.Id }"
40        }
41      },
42      "label": "{! $SObjectType.cgcloud__Promotion__c.fields.cgcloud__Promotion_Template__c.label }",
43      "autoSelectFirstItem": true
44    },
45    {
46      "id": "promoDateFrom",
47      "type": "Date",
48      "label": "{!$SObjectType.cgcloud__Promotion__c.fields.cgcloud__Placement_Date_From__c.label}",
49      "outputProperty": "InStoreDateFrom",
50      "required": true,
51      "defaultValue": "{! promotionData.cgcloud__Placement_Date_From__c || 'today' }"
52    },
53    {
54      "id": "promoAnchorAccount",
55      "type": "Picklist",
56      "active": true,
57      "visible": true,
58      "required": true,
59      "outputProperty": "AnchorAccount",
60      "source": {
61        "class": "DerivePromotionWizardCallable",
62        "method": "getAccounts",
63        "cache": true,
64        "params": {
65          "promotionId": "{! promotionData.Id }",
66          "inStoreDateFrom": "{! promoDateFrom }"
67        }
68      },
69      "label": "{! $SObjectType.cgcloud__Promotion__c.fields.cgcloud__Anchor_Account__c.label }",
70      "autoSelectFirstItem": true
71    },
72    {
73      "id": "deriveAttachments",
74      "type": "Checkbox",
75      "outputProperty": "DeriveAttachments",
76      "label": "{! $Label.cgcloud__PC_LBL_DERIVE_ATTACHMENTS }"
77    }
78  ],
79  "footerLeftButtons": [
80    "cancel"
81  ],
82  "footerRightButtons": [
83    {
84      "type": "saveAndCopy",
85      "brand": "neutral",
86      "label": "{! $Label.cgcloud__NPW_BTN_SAVE_AND_COPY }"
87    },
88    {
89      "type": "saveAndEdit",
90      "brand": "neutral",
91      "label": "{! $Label.cgcloud__NPW_BTN_SAVE_AND_EDIT }"
92    },
93    {
94      "type": "submit",
95      "brand": "brand",
96      "label": "{! $Label.cgcloud__NPW_BTN_SAVE }"
97    }
98  ]
99}