function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
LoretoLoreto 

LWC: display lookup field as text

Hi every body I am creating a LWC that display a form with info from other object. The fields that I want to display from this objects are a Formula and a Lookup field but the Lookup field I want the text of this field not the lookup.
From the apex class y bring the data of the Id that i pass to this method and then I query with this Id and bring some text fields, formula fields and lookup fields.
But the problem is when I try to display de lookup fomula (only the Name not the posibility to modify this field) the info does not appear and the same happend to the Formula.
Can anybody help me? I cant find examples.
Devid JohnDevid John

if you are using lightning-input-field inside inside lwc form you can use readonly="true" or disabled attributes on this. 

or can also use lightning-output-field inside form.

AMEERBASHA NerametlaAMEERBASHA Nerametla

The fields that I want to display from this objects are a Formula and a Lookup field but the Lookup field I want the text of this field not the lookup. From the apex class y bring the data of the Id that i pass to this method and then I query with this Id and bring some text fields, formula fields and lookup fields.