nerdexam
Salesforce

PDI · Question #185

Universal Containers wants to ensure that all new leads created in the system have a valid email address. They have already created a validation rule to enforce this requirement, but want to add an…

The correct answer is C. Use a before-save Apex trigger on the Lead object to validate the email address and display an. To add an extra layer of validation for email addresses on new leads, a before-save Apex trigger is the most suitable automation.

Submitted by valeria.br· Apr 18, 2026Logic and Process Automation

Question

Universal Containers wants to ensure that all new leads created in the system have a valid email address. They have already created a validation rule to enforce this requirement, but want to add an additional layer of validation using automation. What would be the best solution for this requirement?

Options

  • ASubmit a REST API Callojt with a JSON payload and validate the f elds on a third patty system
  • BUse an Approval Process to enforce tne completion of a valid email address using an outbound
  • CUse a before-save Apex trigger on the Lead object to validate the email address and display an
  • DUse a custom Lightning web component to make a callout to validate the fields on a third party

How the community answered

(30 responses)
  • A
    3% (1)
  • B
    20% (6)
  • C
    70% (21)
  • D
    7% (2)

Why each option

To add an extra layer of validation for email addresses on new leads, a before-save Apex trigger is the most suitable automation.

ASubmit a REST API Callojt with a JSON payload and validate the f elds on a third patty system

Making a REST API callout to a third-party system would be an asynchronous operation, typically occurring after the record is saved (after-save trigger), and isn't ideal for preventing record creation directly or displaying immediate UI errors for synchronous validation.

BUse an Approval Process to enforce tne completion of a valid email address using an outbound

An Approval Process is used for managing approval flows for records, not for real-time field-level validation and preventing initial record creation based on field content like email format.

CUse a before-save Apex trigger on the Lead object to validate the email address and display anCorrect

A before-save Apex trigger executes before the record is saved to the database, allowing custom validation logic to be applied and an error message to be displayed directly on the UI if the email is invalid, thereby preventing record creation. This provides a server-side, programmatic validation layer beyond standard validation rules.

DUse a custom Lightning web component to make a callout to validate the fields on a third party

A Lightning web component is a client-side component and would perform client-side validation; while useful, it doesn't provide the server-side, programmatic enforcement that a before-save trigger offers for preventing persistence of invalid data.

Concept tested: Before-save Apex trigger for record validation

Source: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_events.htm

Topics

#Apex Triggers#Before-Save Logic#Server-side Validation#Error Handling

Community Discussion

No community discussion yet for this question.

Full PDI Practice