Get Started with Consumer Goods Cloud
Derive and Copy Promotions with MetadataWizard and Business Object API
Metadata Definition
Metadata Wizard Expression
Metadata Components
Promotion Wizard Input Structure
API End-of-Life Policy
Previous Versions
This document describes the input that SmartUI generates when initializing the new metadata-driven promotion wizard. SmartUI extracts information on where the user clicked when launching the wizard in order to provide as much information as possible to the wizard so it can be used to provide sensible defaults.
1{
2 "Slogan": "Sample Slogan",
3 "GroupText": "Sample Group Text",
4 "initialDate": 1603670400000,
5 "AnchorAccount": "0012X000023GAClQAO",
6 "criterion_1_product__c": "a2L2X00000Bw3LeUAJ",
7 "criterion_3_product__c": "a2L2X00000Bw3MxUAJ",
8 "pack_size_unit__c": "pk",
9 "PromotionTemplate": "a2a2X000003NMgFQAW",
10 "product_form__c": "Solid"
11}This method returns a list of items with the following properties:
| Property Name | Type | Description |
|---|---|---|
| Slogan | String | Promotion slogan of the row where the user clicked to create a new promotion. |
| GroupText | String | Group text of the row where the user clicked to create a new promotion. |
| initialDate | Number | Timestamp of the date on the calendar view the user clicked on in milliseconds. |
| AnchorAccount | Id | Account of the row where the user clicked to create a new promotion. |
| PromotionTemplate | Id | Promotion template of the row where the user clicked to create a promotion. |
| criterion_<X>_product__c | Id | Product hierarchy of the row where the user clicked to create a promotion. |
| <x>__c | String | Additional product grouping attributes present in the row where the user clicked to create a promotion. |
1{
2 "promotionId": "a2a2X000003NMgFQAW"
3}This method returns a list of items with the following properties:
| Property Name | Type | Description |
|---|---|---|
| promotionId | String | ID of the promotion that is copied. |
1{
2 "promotionId": "a2a2X000003NMgFQAW"
3}This method returns a list of items with the following properties:
| Property Name | Type | Description |
|---|---|---|
| promotionId | String | ID of the promotion that is derived.. |
MetadataWizard engine can be used in Aura components to render wizards in your custom Aura components.
Component Markup
1<aura:component implements="..." >
2 <aura:handler name="init"
3 value="{!this}"
4 action="{!c.doInit}"
5 />
6 <!-- Add wizard to markup -->
7 <cgcloud:MetadataWizard aura:id="wizard"></cgcloud:MetadataWizard>
8</aura:component>Component Controller
1({
2 doInit : function(component, event, helper) {
3 // initialize the wizard
4 component.find('wizard').runWizard({
5 metadataName: 'NewPromotion', // MetadataWizard metadata name to load the configuration from
6 modal: false, // If the content will be rendered in a modal window or in place.
7 input: { // Initial input state
8 TestCheckbox: true
9 }
10 })
11 .then($A.getCallback((result) => {
12 // Show spinner
13 component.find('wizard').showSpinner(); // Display a spinner
14 // process the result
15 console.log('Result Action: ', result.action); // Action that triggered the the resolution
16 console.log('Result: ', result.result); // Wizard result, this can be passed to an API
17 console.log('Result: ', result.stateBeforeSubmit); // Wizard state before submission
18 // hide spinner
19 component.find('wizard').hideSpinner(); // Hide the spinner
20 }));
21 });
22 }
23})| Parameter | Type | Required | Default Value | Description | |
| metadata | Object | true* | Object representing the Wizard metadata (same format as on MetadataWizard Configuration Record). | ||
| metadataName | String | true* | MetadataWizard configuration record name to extract the metadata from. | ||
| input | Object | FALSE | {} | Metadata Wizard Input. This object can be accessed in expressions using the _input_ identifier. | |
| stateBeforeSubmit | Boolean | FALSE | FALSE | Represents the state of the wizard input state between executions of the runWizard function. | |
| modal | Boolean | FALSE | FALSE | If true, the wizard will e rendered as a modal. If false, the wizard will be rendered inline. |