3

I'm following the instructions here to create custom validation for a Lightning Component in my Flow:

Available For Flow Screens

Custom Validation

Salesforce validates each flow screen when the user attempts to navigate to the next screen. If the flow screen is not valid, the user can’t progress. To validate the component with the flow screen, declare the validate attribute in the component. Set the validate attribute to a custom validation function that must return two parameters: isValid and errorMessage.

The validation works, and the error message is displayed, but its at the very bottom of the component. Is there a way I can control placement of the error message, like to somewhere closer to the top of the component? Right now it displays after my custom component and the footer button bar:

enter image description here

1
  • Were you able to control placement of the error message (Maybe show to the top of the component)
    – lambad
    Sep 18, 2020 at 6:17

1 Answer 1

2

I wound up hiding the Flow footer and creating my own [Next] button. Clicking the [Next] button triggers JS controller code that validates the input.

3
  • But then how do you progress the flow, or close the modal?
    – wizulus
    Jul 27, 2019 at 15:04
  • It's possible to dispatch Flow-specific events with both aura and LWC, @wizulus. Aura documentation & LWC wtih lightning-flow-support module
    – nbrown
    Jun 3, 2020 at 19:26
  • @nbrown that's what I did. I followed the material "Customize the Flow Footer with an Aura Component" section. Jun 4, 2020 at 12:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.