You need to sign in to do that
Don't have an account?
Nadia Gainsbourg 17
Change field label in lightning component
Hello! I'm referencing two lookup fields in my Lightning component -- Account ID and Contact ID in the Case object. These fields, unfortunately, appear that way on the front end. Could someone help figure out the syntact for changing the field labels to appear as Account and Contact Name? What I'd use on a VF page doesn't work for Lightning components, as I've found out. Thank you!
Greetings to you!
It seems like you are using lightning:inputField or lightning:outputField in your component.
-> You can use the lightning:outputField variant of "label-hidden" along with a label tag to achieve this.
-> If you are using lightning:inputField, then variant="label-hidden" is not working as of now. Known issue: https://success.salesforce.com/issues_view?id=a1p3A000001PYUKQA4
However, you can use CSS like this:
Component:
CSS:
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas
Thanks,
Manish
<label for="aid">Account</label>
<lightning:outputField aura:id="aid" fieldName="AccountId" variant="label-hidden"/>