New Year Sale 2026! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Salesforce Certified Platform Developer II (Plat-Dev-301) Exam - Topic 8 Question 91 Discussion

Actual exam question for Salesforce's Salesforce Certified Platform Developer II (Plat-Dev-301) exam
Question #: 91
Topic #: 8
[All Salesforce Certified Platform Developer II (Plat-Dev-301) Questions]

A developer created a Lightning web component that uses a lightning-record-edit-form to collect information about Leads. Users complain that they only see one error message at a time about their input when trying to save a Lead record.

What is the recommended approach to perform validations on more than one field, and display multiple error messages simultaneously with minimal JavaScript intervention?

Show Suggested Answer Hide Answer
Suggested Answer: D

Contribute your Thoughts:

0/2000 characters
Weldon
3 months ago
Try/catch/finally won't help with form validations, just saying.
upvoted 0 times
...
Chaya
3 months ago
Surprised there's no built-in support for multiple error messages!
upvoted 0 times
...
Daisy
3 months ago
I think using an external JavaScript library could complicate things.
upvoted 0 times
...
Shala
4 months ago
I disagree, Apex triggers might be better for complex logic.
upvoted 0 times
...
Ammie
4 months ago
Validation rules are the way to go!
upvoted 0 times
...
Kip
4 months ago
I keep thinking about that try/catch block, but it doesn't really fit for displaying multiple messages, right?
upvoted 0 times
...
Lauran
4 months ago
I feel like we had a practice question about error handling in Lightning components, and validation rules were the answer there too.
upvoted 0 times
...
Alpha
4 months ago
I'm not entirely sure, but I think using an Apex trigger might complicate things more than necessary for this scenario.
upvoted 0 times
...
Lili
5 months ago
I remember we discussed using validation rules in class, and it seems like the best option for showing multiple errors without much coding.
upvoted 0 times
...
Suzan
5 months ago
I'm a little confused on the difference between the validation rules and the Apex trigger. Are they both valid options, or is one better than the other for this scenario? Might need to ask the instructor for some clarification.
upvoted 0 times
...
Mozell
5 months ago
Ooh, I like the idea of using an external JavaScript library. That could give me more flexibility in how I handle the validations and error messages. Might be worth looking into some options for that.
upvoted 0 times
...
Alline
5 months ago
This looks like a tricky one. I'm not sure if I should go with the try/catch/finally block or the validation rules. Might need to do some research on the best approach here.
upvoted 0 times
...
Haydee
5 months ago
Hmm, I think the validation rules might be the way to go. That way I can handle multiple field validations without having to write a bunch of custom JavaScript. Seems like the most straightforward solution.
upvoted 0 times
...
Maybelle
5 months ago
I think I'm going to go with D on this one. Logging the script executions to Stackdriver and then using BigQuery to analyze the logs seems like a more robust and flexible solution. That way I can dig into the data and set up custom alerts if needed.
upvoted 0 times
...
Mitsue
5 months ago
I'm feeling a bit lost here. There are a lot of factors to consider, and I'm not sure I fully understand the context of CSM suite implementations. I'll need to do some quick research to make sure I'm on the right track.
upvoted 0 times
...
Daniel
10 months ago
Wait, so we can't use Thanos to snap our errors away? Darn, guess I'll have to go with the validation rules then.
upvoted 0 times
Toi
8 months ago
C: I agree, it's the most efficient approach for handling validations on multiple fields.
upvoted 0 times
...
Arlene
8 months ago
B: Yeah, that's the way to go for displaying multiple error messages at once.
upvoted 0 times
...
Merissa
9 months ago
A: Validation rules
upvoted 0 times
...
...
Lezlie
10 months ago
Apex trigger? Really? That's overkill for this use case. Validation rules all the way, easy peasy!
upvoted 0 times
...
Tarra
10 months ago
Oh man, I was about to suggest the try/catch/finally block, but that's way too much manual code. Validation rules for the win!
upvoted 0 times
Ona
9 months ago
User1: Definitely, it's a more efficient approach for displaying errors on multiple fields.
upvoted 0 times
...
Carylon
9 months ago
User3: I've had success with validation rules too, they make it simple to handle multiple field validations.
upvoted 0 times
...
Stevie
9 months ago
User2: Yeah, it's much easier than using try/catch/finally blocks.
upvoted 0 times
...
Lucina
10 months ago
User1: I agree, validation rules are the way to go for displaying multiple error messages.
upvoted 0 times
...
...
Goldie
10 months ago
I was thinking about using an external JavaScript library, but validation rules seem like a simpler and more native solution. Gotta love that declarative approach!
upvoted 0 times
Eleni
10 months ago
I agree, using validation rules is the best approach for handling multiple field validations. It's a declarative way to ensure data integrity.
upvoted 0 times
...
Jin
10 months ago
Validation rules are definitely the way to go for displaying multiple error messages at once. It's a native solution that keeps things simple.
upvoted 0 times
...
...
Mitzie
10 months ago
I think using a Try/catch/finally block could also work, but it would require more JavaScript coding and may not be as efficient as using validation rules.
upvoted 0 times
...
Susana
11 months ago
I agree with Cherry. Validation rules are declarative and easy to set up, making it efficient to display multiple error messages without much JavaScript coding.
upvoted 0 times
...
Katlyn
11 months ago
Hmm, option C sounds like the way to go. Validation rules can handle multiple field validations without the need for JavaScript. Minimal code and no external libraries, just clean Salesforce configuration.
upvoted 0 times
France
10 months ago
User1: Let's go with validation rules for multiple error messages then.
upvoted 0 times
...
Carol
10 months ago
User3: It's definitely the cleanest solution without needing extra JavaScript.
upvoted 0 times
...
Nida
10 months ago
User2: Yeah, validation rules can handle multiple field validations easily.
upvoted 0 times
...
Arlean
10 months ago
User1: I agree, option C with validation rules seems like the best choice.
upvoted 0 times
...
...
Cherry
11 months ago
C) Validation rules would be the best approach. They can be set up in Salesforce to validate multiple fields at once and display all error messages.
upvoted 0 times
...

Save Cancel