Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Salesforce Exam Platform Developer II Topic 2 Question 110 Discussion

Actual exam question for Salesforce's Platform Developer II exam
Question #: 110
Topic #: 2
[All Platform Developer II Questions]

As part of a custom interface, a developer team creates various new Lightning web components. Each of the components handles errors using toast messages. When the development is complete, all the components are added to the same Lightning page.

During acceptance testing, users complain about the long chain of toast messages that display when errors occur loading the components.

Which two techniques should the developer implement to improve the user experience?

Choose 2 answers

Show Suggested Answer Hide Answer
Suggested Answer: A, D

The scenario describes a common issue when multiple components are used on the same Lightning page and each component manages its error handling independently, leading to a 'long chain of toast messages' which can be overwhelming for users.

To improve user experience, the developers can implement the following techniques:

A . Use a Lightning web component to aggregate and display all errors: This method involves creating a centralized component responsible for handling all error messages. This component would receive error notifications from other components and then display them in a user-friendly manner. The benefit of this approach is that it provides a single, consistent interface for error messages, reducing the clutter and confusion that can be caused by multiple toasts.

D . Use public properties on each component to display the error messages: By using public properties, components can expose their error states to a parent or orchestrating component, which can then display these errors in a single, consolidated way. This avoids the issue of multiple toast notifications and allows for a more integrated error handling experience.

The other options presented are less ideal:

B . Using the window.alert() method is not recommended in a professional Salesforce environment as it is considered a disruptive way to show errors and does not align with the Salesforce Lightning design system.

C . Using a <template> tag to display in-place error messages could be a viable option for displaying error messages within the component itself, but it does not address the issue of multiple errors stacking up from different components as described in the scenario.


For building a centralized error handling component: Lightning Web Components Developer Guide - Error Handling

For implementing public properties: Lightning Web Components Developer Guide - Public Properties

Contribute your Thoughts:

Cassi
1 days ago
I agree with Jodi. It would make the user experience much better by consolidating the error messages.
upvoted 0 times
...
Keneth
5 days ago
I think using a Lightning web component to aggregate and display all errors is a great idea. It will help to consolidate the toast messages and provide a more streamlined user experience.
upvoted 0 times
...
Jodi
13 days ago
I think using a Lightning web component to aggregate errors would be a good idea.
upvoted 0 times
...

Save Cancel