ccrz.ccApiConfig.setBulk
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> fetch(Map<String, Object>)
Service Layer Classes
This method doesn't support service layer extensions or overrides.
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.ccApiConfig.CONFIG_JSON
- String of the serialized JSON configuration data to load.
- ccrz.ccApiConfig.FILE_NAME_LIST
- List<String> of filenames within the static resource that contain the JSON-formatted configuration data to load.
- ccrz.ccApiConfig.STATIC_RESOURCE
- String that specifies the name of a static resource that contains the JSON
data to load. Don't include the .resource extension.
For example, if your static resource name is
configDataToLoad.resource, specify only
configDataToLoad for this key
value.
ccrz.ccApiConfig.STATIC_RESOURCE => 'configDataToLoad'
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.
Example for a Static Resource
Load configuration data from a static resource named configDataToLoad.resource, which includes two files with JSON-formatted configuration data, configDataFile.json and configDataFile2.json.
Map<String, Object> configDataFromStaticResource = new Map<String, Object>{
ccrz.ccApi.API_VERSION => ccrz.ccAPI.CURRENT_VERSION,
ccrz.ccApiConfig.STATIC_RESOURCE => 'configDataToLoad',
ccrz.ccApiConfig.FILE_NAME_LIST => new List<String>{'configDataFile.json', 'configDataFile2.json'};
};
try {
ccrz.ccApiConfig.setBulk(configDataFromStaticResource);
} catch (Exception e) {
// Error handling...
}
In each JSON file in the static resource, use the following format.
{
"ConfigurationMetas":[
{
"Name":"piname",
"APIName":"piname",
"Description":"Header Include End Page Include",
"ExternallySafe":false,
"Configurations":[
{
"TextValue":"cc_EmptyPage",
"Storefront":"Global",
"PageName":"all",
"Name":"a0M360000015nqH"
}
]
},
{
"Name":"enabled",
"APIName":"enabled",
"Description":"Header Include End Enablement flag",
"ExternallySafe":false,
"Configurations":[
{
"TextValue":"FALSE",
"Storefront":"Global",
"PageName":"all",
"Name":"a0M360000015nqT"
}
]
}
],
"APIName":"hie",
"Name":"Header Include End"
}
Example for Serialized JSON
Load configuration data from a serialized JSON string.
Map<String, Object> configDataFromString = new Map<String, Object>{
ccrz.ccApi.API_VERSION => ccrz.ccAPI.CURRENT_VERSION,
ccrz.ccApiConfig.CONFIG_JSON => '[
{
"ConfigurationMetas":[
{
"Name":"piname",
"APIName":"piname",
"Description":"Header Include End Page Include",
"ExternallySafe":false,
"Configurations":[
{
"TextValue":"cc_EmptyPage",
"Storefront":"Global",
"PageName":"all",
"Name":"a0M360000015nqH"
}
]
},
{
"Name":"enabled",
"APIName":"enabled",
"Description":"Header Include End Enablement flag",
"ExternallySafe":false,
"Configurations":[
{
"TextValue":"FALSE",
"Storefront":"Global",
"PageName":"all",
"Name":"a0M360000015nqT"
}
]
}
],
"APIName":"hie",
"Name":"Header Include End"
}
]'
};
try {
ccrz.ccApiConfig.setBulk(configDataFromString);
} catch (Exception e) {
// Error handling...
}