Example Messaging Relationship Setup: Creating Parent and Child Records from a Flat Source

This section provides details of an example messaging scenario that creates parent and child records from data in a spreadsheet.

In this scenario, we want to build a messaging relationship to transfer details from imported data to create custom expense reports and expense lines for field agent expenses. To do this, we will use a custom staging object called Imported Expense to store imported data and use this as our source object in our messaging relationship. Our custom target objects are called Expense Report (Field Agent) and Expense Line and have a master-detail relationship.

We can also use messaging to chunk the imported data into batches to limit the number of expense lines on an expense report. If a parent expense report for an expense line does not exist in the org, it is created automatically. This option requires a master-detail relationship between the target objects.

Build a Solution Using Messaging

You can use messaging to send data from one record to both a parent and child record in a master-detail relationship.

The configuration used in this example is set up to show a simple use case:

  • The staging object consists of text and date fields
  • Target lookups contain unique values so only field mappings are used

You can configure more complex mapping scenarios, for example, using the advanced lookup field type or data transformation tables, if required. For more information about more complex mapping configurations, see Adding Mappings to a Messaging Relationship.

Import Data and Manage Messages