I need to display records of an object in lightning component. Since the number of fields to be displayed is very high, I want to store fields in custom setting and iterate over it instead writing each fields on code. So my sample code is something like this.

<aura:iteration items="mycustomsetting" var="fieldname">

But this syntax is not supported. Want to know will this be possible via the correct syntax or some other way around


It is possible but it is easier if you just use lightning:recordForm from https://developer.salesforce.com/docs/component-library/bundle/lightning:recordForm/documentation You can pass list of fields, comma separated to it, and set the mode to view this way you achieve it without iteration.

|improve this answer|||||

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.