APEX の設定
APEX レイヤーの Promotion Save プロセスをカスタマイズするには、コール可能な APEX クラスをカスタマイズフックとして導入する必要があります。
フックを設定するには、Setup → Custom Metadata Types → CGCloud Process Customization に移動して、次のレコードを追加します。
- 表示ラベル: TPM_Promotion_Save
- API 参照名: TPM_Promotion_Save
- クラス: <コール可能な APEX クラス>
- 有効化: チェック済み
- メソッド: save
- Apex クラスの構造
-
1global class <Your Callable APEX Class> implements System.Callable { 2 3 global Object call(String action, Map<String, Object> args) { 4 // Get the TPM_Promotion instance from the arguments 5 TPM_Promotion promotion = (TPM_Promotion) args.get('promotion'); 6 // Retrieve your custom state sent to UI 7 String payload = (String) args.get('customState'); 8 // Read Transaction Id 9 String txId = (String) args.get('txId'); 10 11 // Your custom logic goes here 12 } 13}
call メソッドは、Promotion Save プロセスでコールされます。このメソッドでは、カスタマイズを次のプロセスに追加できます。
- 追加レコードの作成
- TPM レコードの変更