You need to sign in to do that
Don't have an account?
Shuhbam Sinha
How to get the list of object and its all fields in LWC
Hello Everyone,
I have one requirement to create one LWC component and fetch list of objects and its associated fields by creating two lightning comboboxes one for list of object and one for list of fields from selected object. Once user selects the field it should show the api name of the field. Can anyone please help me on the same. Thanks in advance
I have one requirement to create one LWC component and fetch list of objects and its associated fields by creating two lightning comboboxes one for list of object and one for list of fields from selected object. Once user selects the field it should show the api name of the field. Can anyone please help me on the same. Thanks in advance
If you want to fetch the data from a Standard Object you can use the wire get data form:
- https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.data_wire_example
If you want to fetch more complex data related to Custom Objects, you can use imperative methods like this:
- https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.apex_call_imperative
- https://developer.salesforce.com/forums/?id=9062I000000R10IQAS
Let me know this information has helped you.