Ask Search:
Michael CookMichael Cook 

Can you add a 'section' from a page layout in Classic to a Lightning Component?

We have a managed package which renders in a 'section' on a Classic Account Page Layout and I'm curious if I can add a component and have it only display the fields from this particular Section.

As far as I know once you add "Record Detail" it will pull in data from all the sections on the page layout but i'd like to add a "Record Detail" component to my lighthing page and filter to only show this one section.  Does anyone know if this is doable?

Best Answer chosen by Michael Cook
Christine MarshallChristine Marshall
Hi Michael,

You can also use an Update Record Action to achieve this. The fields will be editable but not compulsory so this is not suitable for required fields.

You can remove the fields from the main page layout and add them to an update record action, then display your action in it's own component. You can also make the component dependant e.g. only display if...

1) Edit your page layout and remove the fields you want to display in the other tab
2) From Setup, Manage Objects, your object, choose 'Buttons, Links and Actions' from the menu on the left hand side
3) Choose 'New Action'
4) Change 'Action Type' to 'Update Record'
5) Choose target object e.g. if you are working on the opportunity object then the target object would also be opportunity
5) Give it a name
6) After you click 'Save' it will take you to a layout screen, remove all fields you are not interested in and add the fields you do want (the ones you've taken off the main page layout), click Save once you're done
7) Head back to edit the Lightning record page, drag 'Related Record' from the list on the left hand side onto your page layout
9) Lookup field equals the record you were viewing (e.g. 'Use this Opportunity'), Update Action equals the name of your new action, Create Action equals your object (you should just leave the default as is)

Let me know if any of this is unclear or you need a screenshot etc. Looks like a lot of steps but the whole process takes about 5-10mins from start to finish! 

All Answers

Tom HoffmanTom Hoffman
Hi Michael, there is a way to do this using a field set.  

Under your object (in classic), create a field set, adding the fields you want to see in the component.  You can then use this component from the app exchange to display them (https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000ErEqoUAF)

The limitation of this component is it is read only - though right now I there are some people I know are working on an editable field set component.  
Christine MarshallChristine Marshall
Hi Michael,

You can also use an Update Record Action to achieve this. The fields will be editable but not compulsory so this is not suitable for required fields.

You can remove the fields from the main page layout and add them to an update record action, then display your action in it's own component. You can also make the component dependant e.g. only display if...

1) Edit your page layout and remove the fields you want to display in the other tab
2) From Setup, Manage Objects, your object, choose 'Buttons, Links and Actions' from the menu on the left hand side
3) Choose 'New Action'
4) Change 'Action Type' to 'Update Record'
5) Choose target object e.g. if you are working on the opportunity object then the target object would also be opportunity
5) Give it a name
6) After you click 'Save' it will take you to a layout screen, remove all fields you are not interested in and add the fields you do want (the ones you've taken off the main page layout), click Save once you're done
7) Head back to edit the Lightning record page, drag 'Related Record' from the list on the left hand side onto your page layout
9) Lookup field equals the record you were viewing (e.g. 'Use this Opportunity'), Update Action equals the name of your new action, Create Action equals your object (you should just leave the default as is)

Let me know if any of this is unclear or you need a screenshot etc. Looks like a lot of steps but the whole process takes about 5-10mins from start to finish! 
This was selected as the best answer
Michael CookMichael Cook

Thank you both for your reponses!

@Tom - I would prefer to avoid installing a 3rd party app since my org currently had too many (my humble opinion) but I do like your solution.  

@Christine - That worked flawlessly and I'm so excited that this is possible.  You're a rockstar!

-Mike

Christine MarshallChristine Marshall
Thank you so much Michael! Your comment just made my Monday morning infinitely better :)