You need to sign in to do that
Don't have an account?
How to make input form Readonly based on User profile in Lightning Component?
I have an Action button in our lightning Page, upon clicking it shows a form to input couple of fields and save it. But I have to make those input fields readonly for Profile 1 and editable for Profile 2.
Let me know how I can achieve this. If possible within Lightning component itself by checking profile of the current user, As I am already calling server side script upon clicking this button in doinit and form based on the return values.
Is it possible that i get 2 return values from apex and one of them will be to read the profile and make the input fields readonly.
Thanks.
Let me know how I can achieve this. If possible within Lightning component itself by checking profile of the current user, As I am already calling server side script upon clicking this button in doinit and form based on the return values.
Is it possible that i get 2 return values from apex and one of them will be to read the profile and make the input fields readonly.
Thanks.
You can use lightning:recordEditForm component, it will automatically shows fields in form according to user accessiblity.
Or, you can return a wrapper from server-side-action in doInit with your previous data along with user-profile details and apply that on component.