Promotion Wizard Input Structure

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.

Input Sample for New Promotion 

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}

Properties 

This method returns a list of items with the following properties:

Property NameTypeDescription
SloganStringPromotion slogan of the row where the user clicked to create a new promotion.
GroupTextStringGroup text of the row where the user clicked to create a new promotion.
initialDateNumberTimestamp of the date on the calendar view the user clicked on in milliseconds.
AnchorAccountIdAccount of the row where the user clicked to create a new promotion.
PromotionTemplateIdPromotion template of the row where the user clicked to create a promotion.
criterion_<X>_product__cIdProduct hierarchy of the row where the user clicked to create a promotion.
<x>__cStringAdditional product grouping attributes present in the row where the user clicked to create a promotion.

Input Sample for Copy Promotion 

1{
2    "promotionId": "a2a2X000003NMgFQAW"
3}

Properties 

This method returns a list of items with the following properties:

Property NameTypeDescription
promotionIdStringID of the promotion that is copied.

Input Sample for Derive Promotion 

1{
2    "promotionId": "a2a2X000003NMgFQAW"
3}

Properties 

This method returns a list of items with the following properties:

Property NameTypeDescription
promotionIdStringID of the promotion that is derived..

Using MetadataWizard in custom components 

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})
ParameterTypeRequiredDefault ValueDescription 
metadataObjecttrue* Object representing the Wizard metadata (same format as on MetadataWizard Configuration Record). 
metadataNameStringtrue* MetadataWizard configuration record name to extract the metadata from. 
inputObjectFALSE{}Metadata Wizard Input. This object can be accessed in expressions using the _input_ identifier. 
stateBeforeSubmitBooleanFALSEFALSERepresents the state of the wizard input state between executions of the runWizard function. 
modalBooleanFALSEFALSEIf true, the wizard will e rendered as a modal. If false, the wizard will be rendered inline.