新しいプロモーションウィザードの入力構造
このドキュメントでは、新しいメタデータ駆動のプロモーションウィザードの初期化時に SmartUI で生成される入力について説明します。SmartUI は、ウィザードの起動時にユーザーがどこをクリックしたかについての情報を抽出します。これは、ウィザードにできる限り多くの情報を提供し、それを元に適切なデフォルト値を設定できるようにするためです。
入力の例
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}プロパティ
このメソッドは、次のプロパティを持つ項目のリストを返します。
| プロパティ名 | 型 | 説明 |
|---|---|---|
| Slogan | String |
新規プロモーションを作成するためにユーザーがクリックした行のプロモーションスローガン。 |
| GroupText | String |
新規プロモーションを作成するためにユーザーがクリックした行のグループテキスト。 |
| initialDate | Number | ユーザーがクリックしたカレンダービューの日付のタイムスタンプ (ミリ秒単位)。 |
| AnchorAccount | Id |
新規プロモーションを作成するためにユーザーがクリックした行の取引先。 |
| PromotionTemplate | Id |
プロモーションを作成するためにユーザーがクリックした行のプロモーションテンプレート。 |
| criterion_<X>_product__c | Id |
プロモーションを作成するためにユーザーがクリックした行の商品階層。 |
| <x>__c | String |
プロモーションを作成するためにユーザーがクリックした行にある追加の商品グループ属性。 |
カスタムコンポーネントでの MetadataWizard の使用
MetadataWizard エンジンを Aura コンポーネントで使用すると、カスタム Aura コンポーネントでウィザードを表示できます。
- コンポーネントのマークアップ
-
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>
- コンポーネントコントローラー
-
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})
| パラメーター | 型 | 必須 | デフォルト値 | 説明 |
| metadata | Object | true* | ウィザードメタデータを表すオブジェクト (MetadataWizard 設定レコードと同じ形式)。 | |
| metadataName | String | true* | メタデータを抽出する MetadataWizard 設定レコードの名前。 | |
| input | Object | FALSE | {} | メタデータウィザードの入力。式でこのオブジェクトにアクセスするには、_input_ 識別子を使用します。 |
| stateBeforeSubmit | Boolean | FALSE | FALSE | runWizard 関数の実行間のウィザードの入力状態を表します。 |
| modal | Boolean | FALSE | FALSE | true の場合、ウィザードはモーダルとして表示されます。false の場合、ウィザードはインラインで表示されます。 |