2

We have created a custom Page Layout for Case Detail and assigned it to a specific profile. In this layout, we have added multiple sections and rearranged the fields as per client requirement.

If we use the Lightning Aura component "force:recordView", then I could see that the component is rendered properly as per the custom layout defined.

force:recordView recordId="xxxxxxxxxxxxxxx">

If we use the Lightning web component "lightning-record-form", then it is NOT respecting the custom layout i.e., no sections, all the fields displayed.

<lightning-record-form 
    record-id={recordId} 
    object-api-name="Case" 
    mode="readonly" columns="2" layout-type="Full"
></lightning-record-form>

Anyone else facing this issue?

5

Lightning Record Form doesn't yet support sections. It should pull the field list from the profile assignment but it just dumps the whole layout as one big blob of fields.

  • Sad! so we have to do custom implementation to match the layout of force:recordView. Thanks. – wesfaith May 15 at 10:56
  • 1
    Probably. You can fetch layout & section info in LWC via the UI API if that helps. – Charles T May 15 at 12:09
  • Sure, I'll give it a try. – wesfaith May 15 at 18:12
  • 1
    And I do agree it is sad... I complained on the Partner Community already :P – Charles T May 15 at 21:49
  • Can you give me the link of your post in Partner Community?? Is there any commitment from Salesforce to implement this in future or is this intentional? – wesfaith May 16 at 13:24

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.