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
Andy on CloudAndy on Cloud 

Dynamic Rendering Using Fieldsets in Lightning

I couldn't find this in Lightning documentation.  In VF, we can use Fieldsets through Schema Object to loop through all fields and render all fields inside a fieldset so we can change the fields in the fieldset order, read-only, or add/remove fields without changing code.

I cannot find such $ObjectType schema API in Lightning, do we still have access to these when we code in Lightning Expression?
PawanKumarPawanKumar
Please take a look here.
https://salesforce.stackexchange.com/questions/56047/how-to-use-fieldsets-with-lightning

Regards,
Pawan Kumar
Andy on CloudAndy on Cloud
Thanks Pawan but this link is about a solution that I know already (and it's quite old, 2014), the problem is that we need to have extra server roundtrip, not ideal.  I guess my question was more of, it's 2018 already, does the Lightning API natively support client side schema API yet?  I guess not then.
PawanKumarPawanKumar
Sorry, Andy. Good to know it.

Please take a look for lightning here. This may help you with what you need.

https://sfcure.com/2017/09/26/lightning-component-display-records-in-a-dynamic-table-using-fieldset-on-any-object/

Regards,
Pawan Kumar
 
SAKTHIVEL MSAKTHIVEL M
Hi Andy & all,

if still searching to add the fieldset in lightning and please refer the below links:

https://metillium.com/2017/08/lightning-field-set-form-component/
https://metillium.com/2018/02/lightning-field-set-form-component-v2/
https://www.sfdcpanther.com/how-to-use-field-set-in-lightning-component/


Thanks & Regards,
Sakthivel Madesh
Andy on CloudAndy on Cloud
Thank you for all the answers but I guess the short answer is "No".  All these solutions are not a good approach where the schema has to be accessed by going back to Apex to get it.  And if that is the case, might as well using the Metadata API to get the most updated schema instead of buildin custom AuraEnabled Apex code to serve one particular purpose.
Mina Michel GorgyMina Michel Gorgy
Hi everyone,
I'm facing a similar situation and I really need some assistance here!
I have on the Opportunity, stages and steps (dependant dropdowns), and I wanted to show specific fields for every step being selected. 
The user will be selecting which STAGE and which STEP, however will NOT save the final stage and step... He'll only select them CLIENT SIDE, then I would like to show some fields (FieldSet, I assume), that will load with the opportunity data.
Then the user can SAVE some changes on the VISIBLE fields, then the page will reload.

I was able to reach almost all this solution except reflecting back the updated information to the DB... Any hints would be appreciated!?

I believe having 2 apex:repeat tags in my visualforce page is messing it up during saving, althought it works JUST FINE for rendering!

Thanks in advance,
Mina