Copy field from parent when creating a child record

  • 1
  • Question
  • Updated 3 years ago
When creating a child record what is the easiest way to pass a field from the parent to a child?

Here is my situation:  I have a list of insurance policies and I need to add members to the policy.  The role of the member is depended on the type of policy which is a field at the insurance policy level.  In order to assign a role to a person I need to have the correct insurance policy type populate at the child level.  Ideally I would like to put some value when using the Create new row action item.

Thanks for your help.
Photo of Scotty

Scotty

  • 282 Points 250 badge 2x thumb

Posted 3 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Here is what you can do.
- Create a row action on the policy table
- Select type: Run Multiple Actions" 
- Add an action that creates new row on model.  Choose the person model.
- You can add a "substep" under the create new row action that prepopulates data on that new row. 
- Choose the  policy type field in both your policy member model and for value use somthing like {{PolicyType__c}}.   This merges the data for policy type from the row where you selected the row action button and injects it into the new record. 

Then you can open a popup where the rest of the new member information is documented. 
Photo of Scotty

Scotty

  • 282 Points 250 badge 2x thumb
Rob,

Is there any way do do this from the Policy Members Table from a Global Action?  I have a policy details popup where policy members is a tab within the popup.

Thanks
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Sounds like the page will be a policy detail page, where you have a model that has a singe policy.  Then your global action can create a new row in a "new member" model.  This new member model can have a condition where "Policy Type" is the "Policy type" field from the policy model.   This will prepopulate that value in the new member model.