Question 21
Choose 1
Witch static method invocation is used to initialize ccrz.cc_CallContext with information
from ccrz.cc_RemoteActionContext and return an instance of ccrz.cc_RemoteActionResult
in an apex @RemoteAction methos?
Correct answer:
B. ccrz.cc_CallContext.initCallContext(ccrz.cc_RemoteActionContext)
Explanation:
In Salesforce B2B Commerce (ccrz), when you write an Apex @RemoteAction method, you must explicitly initialize the call context so that B2B Commerce APIs (pricing, cart, buyer info, locale, etc.) work correctly.
The required static method is:
ccrz.cc_CallContext.initCallContext(remoteActionContext);
This method:
Takes an instance of ccrz.cc_RemoteActionContext
Initializes ccrz.cc_CallContext with:
Buyer Account
Effective Account
User context
Locale and currency
Enables the method to correctly return a ccrz.cc_RemoteActionResult
This is the only valid and supported method for initializing the call context in an Apex @RemoteAction.
❌ Why the other options are incorrect
A. init(ccrz.cc_RemoteActionContext)
❌ No such method exists in ccrz.cc_CallContext.
C. initRemoteActionContext(ccrz.cc_RemoteActionContext)
❌ Sounds plausible, but Salesforce does not define this method.
D. initializeCallContext(ccrz.cc_RemoteActionContext)
❌ Not a valid API method in B2B Commerce.
Salesforce exam questions often include “reasonable-sounding” method names—this is a classic trap.
📚References
Salesforce Help: B2B Commerce Apex API (ccrz namespace)
Trailhead: B2B Commerce for Developers – Remote Actions
Salesforce B2B Commerce Developer Guide
Section: Using @RemoteAction with ccrz.cc_CallContext
In Salesforce B2B Commerce (ccrz), when you write an Apex @RemoteAction method, you must explicitly initialize the call context so that B2B Commerce APIs (pricing, cart, buyer info, locale, etc.) work correctly.
The required static method is:
ccrz.cc_CallContext.initCallContext(remoteActionContext);
This method:
Takes an instance of ccrz.cc_RemoteActionContext
Initializes ccrz.cc_CallContext with:
Buyer Account
Effective Account
User context
Locale and currency
Enables the method to correctly return a ccrz.cc_RemoteActionResult
This is the only valid and supported method for initializing the call context in an Apex @RemoteAction.
❌ Why the other options are incorrect
A. init(ccrz.cc_RemoteActionContext)
❌ No such method exists in ccrz.cc_CallContext.
C. initRemoteActionContext(ccrz.cc_RemoteActionContext)
❌ Sounds plausible, but Salesforce does not define this method.
D. initializeCallContext(ccrz.cc_RemoteActionContext)
❌ Not a valid API method in B2B Commerce.
Salesforce exam questions often include “reasonable-sounding” method names—this is a classic trap.
📚References
Salesforce Help: B2B Commerce Apex API (ccrz namespace)
Trailhead: B2B Commerce for Developers – Remote Actions
Salesforce B2B Commerce Developer Guide
Section: Using @RemoteAction with ccrz.cc_CallContext
