ccrz.ccApiAttribute.fetch

Executes a SOQL query of attribute records.

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

You can still call older versions of the API for this method, which can accept different input keys or return different output keys. Any differences in behavior for older versions aren't documented in this topic.

Note

Signature

global static Map<String, Object> fetch(Map<String, Object>)

Service Layer Classes

Data Service Provider
ccrz.ccServiceAttribute
Logic Service Provider
ccrz.ccLogicAttrFetch

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.

If this key isn't specified, the method returns a ccrz.ccApi.NoApiVersionException.

Note

Inputs (Optional)

The input map can also include the following keys:

ccrz.ccApi.API_SIZING
Map<String, Object> that specifies the scope of data that this method returns, including which fields the method returns for each record that matches the query.
ccrz.ccApiAttribute.ATTRIBUTEIDS
Map<String, Object> where each key is a parent attribute ID and each value is a List<String> of child attribute IDs:
new Map<String, Object>{
     'ParentAttributeID1' => new List<String>{'ChildAttributeID1', 'ChildAttributeID2', 'ChildAttribute3'},
     'ParentAttributeID2' => new List<String>{'ChildAttributeID4', 'ChildAttributeID6', 'ChildAttribute5'}
}
ccrz.ccApiAttribute.BYAID
Boolean
Value Usage
true Key returned attribute records by the E_Attribute__c field instead of ID:
Map<String, Object>{
    'ParentAttributeID1'+ccrz.ccApiPriceList.DELIMITER+'ChildAttributeID1' => {E_Attribute__c},
    'ParentAttributeID1'+ccrz.ccApiPriceList.DELIMITER+'ChildAttributeID2' => {E_Attribute__c},
    'ParentAttributeID1' => {E_Attribute__c}
}
false (default) Key returned attribute records by ID.
ccrz.ccApiAttribute.IDS
Set<String> of specific attribute IDs to query:
new Set<String>{'Attribute_ID_1', 'Attribute_ID_2'}
ccrz.ccApiAttribute.LOCALE
String that specifies one of your storefront's supported locales.

If the input data doesn't include this key, the method falls back to ccrz.cc_CallContext.userLocale.

Note

ccrz.ccApiAttribute.PARENTIDS
Set<String> of parent attribute ID Platform IDs whose child attributes you want to query.

When you include this key in your input map, the parent attribute records aren't included in the returned attributes. To include parent IDs, specify their IDs in the ccrz.ccApiAttribute.IDS input key.

Important

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.

B2B Commerce for Visualforce doesn't always return an exception for any errors that can occur. When this value is false, consider rolling back the API transaction to a previous savepoint.

Tip

ccrz.ccApiPriceList.ATTRIBUTES
A Map<String, Map<String,Object>> where each Map<String, Object> represents a return attribute, keyed by its ID. To key by E_Attribute__c field instead, include ccrz.ccApiAttribute.BYAID in the input map.