Customize Input Validation Errors for Screen Components
Create a Lightning web component that gives your screen flow users the best experience with the component’s error messages at run time. To customize where and how to display errors, implement these methods in the component to take control of rendering errors.
validate()
setCustomValidity(externalErrorMessage: string)
reportValidity()
The flow calls the validate()
method when a flow user navigates to the next screen or finishes the flow. The flow calls the new setCustomValidity(externalErrorMessage: string)
method when there are input validation errors. When the setCustomValidity(externalErrorMessage: string)
method is called, the component stores the input validation error message from the flow, so it can be displayed later. The flow calls the reportValidity()
method when it’s time to render any errors that your component is aware of.
See Also