Newer Version Available
ExtensionInfo Class
Contains static methods to expose extension-related context information.
Namespace
Example
1// The Sample Extension Provider registered with developer name as
2 // 'tax_extension_provider_for_us' will be selected for execution for en_US locale
3 if(CommerceExtension.ExtensionInfo.getLocaleString() == 'en_US') {
4 return new CommerceExtension.Resolution('tax_extension_provider_for_us');
5 }
6 // The Sample Extension Provider registered with developer name as
7 // 'tax_extension_provider_for_canada' will be selected for execution for en_CA locale
8 if(CommerceExtension.ExtensionInfo.getLocaleString() == 'en_CA') {
9 return new CommerceExtension.Resolution('tax_extension_provider_for_canada');
10 }
11 // The default Salesforce Internal Tax Api will return an empty response for German locale
12 if(CommerceExtension.ExtensionInfo.getLocaleString() == 'de') {
13 return new CommerceExtension.Resolution(CommerceExtension.ResolutionStates.OFF);
14 }ExtensionInfo Methods
The following are methods for ExtensionInfo.
getClientApiVersion()
Returns the version number of the Client API for the extension context.
Signature
public static Double getClientApiVersion()
getLocaleString()
Returns the locale for the extension context.
Signature
public static String getLocaleString()
isCustomParametersAvailable()
Indicates whether custom parameters are available for the extension
context.
Signature
public static Boolean isCustomParametersAvailable()
Return Value
Type: Boolean
Value indicating if custom parameters are available in the extension context (true) or not (false).