I am creating a lightning component that allows users to create case. The standard UI via page layout is not very user friendly. We have several case types and several standard validation rules. I would like to see if there is anyway I can utilize the standard validation rules for client side validation in my component. I don't think there is but wanted to check. We want to make it admin friendly, Any suggestions on how to let admins manage the validation rules but still provide client side validation in the component?

1 Answer 1


I would recommend you to go through following post: Validating Fields

In given post, methods of error handing in Lightning framework are provided. One of the example is:

    Enter a number: <ui:inputNumber aura:id="inputCmp" onError="{!c.handleError}" onClearErrors="{!c.handleClearError}"/> <br/>
    <ui:button label="Submit" press="{!c.doAction}"/>

So, by above example you have the way to show and handle errors in Lightning component.

From the controller (Apex) side when user try to save any record which is against the validation rule there will exception so, you can handle that error in try-catch block. Depending on type of exception, lightning component can be rendered.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .