Which three statements are true regarding extending ccServiceProduct and exposing custom fields on the Product Detail Page?

Salesforce B2B leverages global API’s for encapsulating business logic into blocks that can be extended and modified by subscribers.

Which three statements are true regarding extending ccServiceProduct and exposing custom fields on the Product Detail Page? (3 answers)
A . Override the getFieldsMap method and add subscriber specific code.
B . Ensure that any helper methods are defined as private andstatic only.
C . Create a global with sharing class that extends ccrz.ccServiceProduct.
D . Create a public with sharing class that extends ccrz.ccServiceProduct.
E . Override the fetch method and add your subscriber specific code here.

Answer: A,C,E

Explanation:

To extend ccServiceProduct and expose custom fields on the Product Detail Page, three statements are true:

Override the getFieldsMap method and add subscriber specific code. This method returns a map of field names and field types for the product entity and its related entities. By overriding this method, the subscriber can add their custom fields to the map and make them available for the API.

Create a global with sharing class that extends ccrz.ccServiceProduct. This class will inherit all the methods and properties of the ccServiceProduct class and allow overriding or extending them. The class should be global and with sharing to ensure that it can be accessed by the API framework and respect the sharing rules.

Override the fetch method and add your subscriber specific code here. This method executes the query to fetch the product data and returns a result object. By overriding this method, the subscriber can modify the query or the result object to include their custom fields or logic.

Salesforce Reference: B2B Commerce and D2C Commerce Developer Guide, Service Classes, ccServiceProduct Class

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments