Salesforce-B2C-Commerce-Cloud-Developer Practice Test

Salesforce Spring 25 Release
202 Questions

A Digital Developer added a file named MyBusinessController.js in the cartridge named app_project. The project design calls for this new file to override MyBusinessController.js in client_project. The client_project cartridge contains other necessary functionality. Additional functionality is also included in the storefront_core and storefront_controllers cartridges. Which cartridge path meets the project requirements?

A. client_project:app_project:storefront_controllers:storefront_core

B. app_project:storefront_controllers:storefront_core

C. app_project:client_project:storefront_controllers:storefront_core

D. storefront_core:storefront_controllers:client_project:app_project

C.   app_project:client_project:storefront_controllers:storefront_core

Explanation:

🧠 Goal of Cartridge Path Ordering
The cartridge path determines override priority. When multiple cartridges contain a file with the same name and location, the cartridge listed first in the path takes precedence.

In this case:
MyBusinessController.js exists in both app_project and client_project
You want app_project to override the file in client_project
However, client_project still needs to be present for its other functionality

Option C Explained
app_project:client_project:storefront_controllers:storefront_core
app_project comes first → takes override priority for the controller
client_project still included → retains access to its other logic/components
storefront_controllers and storefront_core are appended for base functionality

This satisfies all the requirements:
Override works ✅
Nothing gets lost ✅
Execution sequence respects dependency order ✅

Why the Other Options Fail
A. client_project:app_project:storefront_controllers:storefront_core
❌ client_project comes before app_project → override fails

B. app_project:storefront_controllers:storefront_core
❌ client_project is missing entirely → breaks needed functionality

D. storefront_core:storefront_controllers:client_project:app_project
❌ Lowest priority given to app_project → override fails

📘 Reference:
From Salesforce B2C Commerce Developer Guide:

When a file exists in multiple cartridges, the version in the cartridge that appears first in the cartridge path is the one used. Ordering is crucial when overriding logic across multiple cartridges.

🧩 Exam Tip
Override logic is frequently tested. Keep a reusable snippet in your notes:
Cartridge Override Logic
Order matters: First listed cartridge wins
Include all required cartridges for functionality
Override + dependency? Place override cartridge first

Salesforce-B2C-Commerce-Cloud-Developer Practice-Test - Home Previous
Page 6 out of 202 Pages