Get Global Account Product List
商品がグローバルリストに含まれるのは、次のいずれかの条件が満たされた場合です。
- 商品のボリュームレコードまたは条件レコードが存在している。
- 顧客用に作成されたプロモーションに商品が含まれている。
- リソース
-
1GET_GLOBAL_ACCOUNT_PRODUCT_LIST - 使用可能なバージョン
- 55.0
- 要求パラメーター
-
名前 型 説明 必須か省略可能 accountId String Salesforce からの取引先レコードの ID。 必須 - Apex 要求の例
-
1// Logical endpoint name 2String endpointName = 'GET_GLOBAL_ACCOUNT_PRODUCT_LIST'; 3// name of the salesorg for which the API must be scheduled 4String salesOrg = '0001'; 5<namespace>.OffplatformCallout callout = new <namespace>.OffplatformCallout(endpointName, salesOrg); 6 7// Log Transaction Id 8String txId = <namespace>.TransactionHandler.getTransactionIdentifier(); 9 10// Account Id for which the products in the global apl should be retrieved 11Id accountId = '001B000001Q48yMIAR'; // Kroger Atlanta 12 13Map<String, String> urlParameters = new Map<String,String>(); 14urlParameters.put('accountid', accountId); 15 16String payload = null; 17 18<namespace>.OffplatformCalloutResponse response = callout.execute(txId, urlParameters, payload); 19 20if (response.status != 200) { 21 // Handle error and return error info to caller 22 23} 24// Fetch the list from the response 25Set<Id> accountproducts = new Set<Id>(); 26String aplListString = (String) response.Result; 27if (!String.isEmpty(aplListString)) { 28 Map<String, Object> mapAccountProductList = (Map<String, Object>) JSON.deserializeUntyped( 29 aplListString 30 ); 31 List<Object> listAccountProductListIds = (List<Object>) mapAccountProductList.get( 32 'accountproducts' 33 ); 34 for (Object obj : listAccountProductListIds) { 35 accountproducts.add((Id) obj); 36 } 37}