ccrz.ccApiPriceList.fetchPriceListItems
Executes a SOQL query of price list item records, and returns a list of price list item
IDs.
Compatibility
This reference applies to:
Release | Managed Package Version | API Version |
---|---|---|
B2B Commerce for Visualforce Winter ’21 | 4.13 | 12 |
B2B Commerce for Visualforce Spring ’20 | 4.12 | 11 |
B2B Commerce for Visualforce Summer ’19 | 4.11 | 10 |
B2B Commerce for Visualforce Spring ’19 | 4.10 | 9 |
B2B Commerce for Visualforce Summer ’18 | 4.9 | 8 |
Signature
global static Map<String, Object> fetchPriceListItems(Map<String, Object>)
Service Layer Classes
- Logic Service Provider
- ccrz.ccServicePL
Inputs (Required)
Map<String, Object> that must include the following required keys:
- ccrz.ccApi.API_VERSION
- The version of the B2B Commerce for Visualforce API to reference for the method call. We recommend that you use the ccrz.ccApi.CURRENT_VERSION constant whenever possible, and only reference a specific version for compatibility if necessary.
Inputs (Optional)
The input map can also include the following keys:
- ccrz.ccApiPriceList.CURRCODE
- String that specifies an ISO 4217 currency code, such as USD or JPY.
- ccrz.ccApiPriceList.EFFACCTID
- String that specifies the ID of an account record to filter price list items by. The method returns only the price list items for the price lists that are assigned to the specified account's account group.
- ccrz.ccApiPriceList.EFFDATEPLI
- Date to filter price list items by. The method returns only the price list item records where the date is included in the Start Date and End Date range.
- ccrz.ccApiPriceList.IDS
-
Set<String> of specific price list IDs
whose items you want to
return:
new Set<String>{'Price_List_ID_1', 'Price_List_ID_2'}
- ccrz.ccApiPriceList.PLI_IDS
-
Set<String> of specific price list item IDs
to
query:
new Set<String>{'Price_List_Item_ID_1', 'Price_List_Item_ID_2'}
- ccrz.ccApiPriceList.PLISERVSPLIT
- Integer that specifies the maximum number of price list items that can pass through ccrz.ccService.transform at once.
- ccrz.ccApiPriceList.PRODUCTIDS
-
Set<String> of specific IDs for the product
records whose price list items you want to
query.
new Set<String>{'Product_ID_1', 'Product_ID_2'}
- ccrz.ccApiPriceList.PRODUCTSKUS
-
Set<String> of specific SKU values for the
product records whose price list items you want to
query.
new Set<String>{'Product_SKU_1', 'Product_SKU_2'}
- ccrz.ccApiPriceList.NAME
- String that specifies the name of a price list whose items you want to return.
- ccrz.ccApiPriceList.STOREFRONT
- String that specifies the name of a storefront for filtering the query.
- ccrz.ccApiPriceList.SUBPRODTERMS
-
Set<String> of specific subscription term
IDs whose price list items you want to
query.
new Set<String>{'SubProdTerm_ID_1', 'SubProdTerm_ID_2'}
Outputs
Map<String, Object> that can include the following keys:
- ccrz.ccApi.API_VERSION
- Integer that indicates which API version was used for the query.
- ccrz.ccApi.SUCCESS
- Boolean
Value Usage true The call completed. false The call encountered errors. - ccrz.ccApiPriceList.PRICELISTITEMS
- Map<String, Map<String,Object>> keyed by the IDs of the returned price list items.
Example
For a set of specific product SKUs, fetch the price list items assigned to those products.
Map<String, Object> priceListItemsToFetch = new Map<String, Object> {
ccrz.ccApi.API_VERSION => ccrz.ccApi.CURRENT_VERSION,
ccrz.ccApiPriceList.PRODUCTSKUS => new Set<String>{'Product_SKU_1', 'Product_SKU_2'},
ccrz.ccApi.SIZING => new Map<String, Object> {
ccrz.ccApiPriceList.ENTITYNAME_PLI => new Map<String, Object> {
ccrz.ccApi.SZ_DATA => ccrz.ccApi.SZ_S
}
}
};
Map<String, Object> priceListItemsFetched = ccrz.ccApiPriceList.fetchPriceListItems(priceListItemsFetched);
System.debug('priceListItemsFetched KEYS=' + JSON.serializePretty(priceListItemsFetched.keySet()));
Boolean success = (Boolean)priceListItemsFetched.get(ccrz.ccApi.SUCCESS);
if(success) {
Map<String, Map<String, Object>> priceListItems = (Map<String, Map<String, Object>>)priceListItemsFetched.get(ccrz.ccApiPriceList.PRICELISTITEMS);
System.debug('pricelistitems=' + JSON.serializePretty(priceListItems));
} else {
List<ccrz.cc_bean_Message> messages = (List<ccrz.cc_bean_Message>)priceListItemsFetched.get(ccrz.ccApi.MESSAGES);
System.debug('messages=' + messages);
}