Adopt Rows into Model for 2 different objects?

  • 1
  • Question
  • Updated 4 years ago
  • Answered
Is it possible to use the Adopt rows into Model action type in one object and create rows in a different object? (Just to clarify, I'm talking about 2 different salesforce objects, not models)

I would like to allow the user to select multiple rows of one object and have it create rows in a different table for a different object. The objects are similar but not the same. I feel like this is not possible because I don't see how it would know which fields to pass where, but thought I'd put it out there.

Photo of Chelsea Curtis

Chelsea Curtis

  • 1,300 Points 1k badge 2x thumb

Posted 4 years ago

  • 1
Photo of Zach McElrath

Zach McElrath, Employee

  • 52,276 Points 50k badge 2x thumb

The "Adopt Rows" action is intended to move rows of the same type of object between different Models on the same object.

The "Create new row(s)" Action, however, should be able to do what you're after -- if you select one or more rows in one Model, and then add a Mass Action with a single "Create new rows" Action, with the "Model to create new rows in" property set to a different Model, you will be creating one row in the other Model for each row in the source Model. Then you will need to click "Add Default Value" to your Create new row action to add a default value for field you want to "map" from the source row to the new row in the target Model.

For example, I'm attaching the XML for an Opportunity detail page where you can click an "Add Line Items" Global Action on the "Products" tab which lets you pick Products from the PricebookEntry object in Salesforce, and then creates new OpportunityLineItem records in a related Model via a "Create new row" action with a few Default Values that map fields from the source PricebookEntry into each new OpportunityLineItem record:

Here is the link to this sample page's XML.