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
Big EarsBig Ears 

lightning-record-form - render with sections

The new "lightning-record-form" Lightning Web Component is great, but it doesn't fully replicate layouts. For instance, layout sections aren't replicated. Is there any way to do this? Or plans for the sections to be supported in future?
Best Answer chosen by Big Ears
Khan AnasKhan Anas (Salesforce Developers) 
Hi,

Greetings to you!

Yes, in LWC, Lightning Record Form doesn't support sections as of now. Please refer to below link from salesforce stack exchange exactly with a similar issue.

https://salesforce.stackexchange.com/questions/262434/lwc-lightning-record-form-is-not-respecting-page-layout

You can use lightning/ui*Api to retrieve sections in LWC. 

https://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.reference_wire_adapters_record_ui

https://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.reference_ui_api

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

All Answers

Khan AnasKhan Anas (Salesforce Developers) 
Hi,

Greetings to you!

Yes, in LWC, Lightning Record Form doesn't support sections as of now. Please refer to below link from salesforce stack exchange exactly with a similar issue.

https://salesforce.stackexchange.com/questions/262434/lwc-lightning-record-form-is-not-respecting-page-layout

You can use lightning/ui*Api to retrieve sections in LWC. 

https://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.reference_wire_adapters_record_ui

https://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.reference_ui_api

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
This was selected as the best answer
Big EarsBig Ears
Khan,

Thank you - I thought that was the case, but was hoping I wouldn't have to!

The RecordUI call for "getRecordCreateDefaults" returns the info. Looks like I might try to use that for now....
https://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.reference_wire_adapters_create_record_values