Salesforce Certified Platform Developer II — Question 238

A developer is working on a set of custom Aura components that can be individually added to a home page. One of the components, c:searchAccounts, allows users to search for an Account and then select a specific found Account. Once selected, the other components should get other information related to the selected Account and display it.

Which event should the c:searchAccounts component fire to make it known that an Account is selected?

Answer options

Correct answer: B

Explanation

The correct answer is B because a component event is specifically designed for communication between components in the same hierarchy, allowing the c:searchAccounts component to notify its parent or sibling components about the selected Account. An application event (A) is used for communication across different parts of the application, a refreshView event (C) is not applicable in this context, and a publish event (D) is typically used in a pub/sub model which does not fit the requirement of notifying specific components.