How do I make child fields editable in a table

  • 1
  • Question
  • Updated 2 years ago
  • Answered
I created model of opportunities with several fields from the related account.  I am using this model in a table and I am displaying fields from both objects on the table.  However, only the fields from the opportunity record appear to be editable.  I can't seem to make the account fields editable as well.  Is there a way to do this?
Photo of Stephen Chilcoat

Stephen Chilcoat

  • 732 Points 500 badge 2x thumb

Posted 2 years ago

  • 1
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Child records are not editable. Best choice would be to set a row action to popup or drawer with the child records in its model.
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,050 Points 10k badge 2x thumb
Only fields on the model's chosen object can be edited in that context. To accomplish what you're after, what I'll often see is a secondary model (or more than one) built on the related objects you're trying to make editable. That secondary model can take its record context from any given row on the table, and can be shown inside a drawer or popup using a row action. The context would need to be set so that the record that was clicked on has its Id passed into the secondary models as a condition. 

Since the drawer's component(s) are connected to the secondary model(s), they can be editable as needed. 

This tutorial does a good job of illustrating the arrangement I'm trying to describe. I hope it gives you some ideas about how to approach your use case. 
Photo of Stephen Chilcoat

Stephen Chilcoat

  • 732 Points 500 badge 2x thumb
Thanks Mark.  That is the solution I am currently employing.  I was hoping I just missed something.