Splitting Source Data into Multiple Target Records
You can set up Foundations messaging to create multiple target records on a single object from data in a single message.
The way you set this up depends on the hierarchical level of the records you are creating in the subscription:
- For the primary target object specified on the subscription: You can create multiple subscriptions that reference that target object.
- For objects that are children or other descendants of the target object specified on the subscription: You can define and specify target child types on mappings to create categories, such as Credit, Debit, and Admin Fee.
The following example shows that a single publication can be used to create the following records:
- Journals, the primary target object in the FFA/BillingDocument.Complete subscription
- Two different categories of journal line items, a child relationship in the FFA/BillingDocument.Complete subscription
- Billing contracts, the primary target object in the FFA/BillingDocument.Complete subscription
Publication |
Subscription |
Target Object |
Target Child Type |
---|---|---|---|
ERP/BillingDocument.Complete | FFA/BillingDocument.Complete | Journal | - |
Journal Line Item | Credit | ||
Journal Line Item | Debit | ||
Billing Central/BillingDocument.Complete | Billing Contract | - |
Target Child Types
A target child type is a category that you define on a child mapping. This enables you to create multiple target child records of different types from a single source child record. You can map different keys to the same target field and ensure that separate records are created for that data. The target child type can be identified on the record as the name of the target child type is appended to the value of the child correlation field. No target child type information is appended for the default target child type.
In some circumstances, you might have source data from one record that you want to be represented by separate target records:
- You want to create target records for the original source data as well as new additional target records, for example, by adding a fixed installation or administration fee to a sales invoice line item
- You want to split the original source data into several separate target records, for example, to represent credit and debit information on separate journal line items
You can create and assign as many target child types as you need for each subscription. Any child mappings that contain a blank target child type are automatically assigned the Default target child type. Target child types are case insensitive.
The following section provides more information about these use cases.
Example: Additional Admin Fee Records
You have a messaging subscription set up to create billing documents and billing document line items. You want to create a separate billing document line item to represent an admin fee whenever a line item is created.
To do this, you can create a mapping for the admin fee details, such as a static fee of $20. You can identify that mapping and any others that you want to appear on that type of record by creating a target child type called Admin Fee.
The following table shows how you can map different information to the same fields using two different child target types.
Key |
Target Child Type |
Target Field |
---|---|---|
Name | Default | Billing Document Line Item Name |
Value | Default | Total Value |
Name | Admin Fee | Billing Document Line Item Name |
Fee | Admin Fee | Total Value |
In this example, if you sent the following message, you would create four records.
Key |
Target Child Type |
Value |
---|---|---|
Name | Default | Internet Services |
Value | Default | 500 |
Name | Admin Fee | Installation |
Fee | Admin Fee | 20 |
Name | Default | Telephone Services |
Value | Default | 100 |
Name | Admin Fee | Installation |
Fee | Admin Fee | 20 |
Example: Separate Credit and Debit Records
You can use target child types to create separate credit and debit records, for example, when creating journal line items.
In this example, the publication includes details of a positive and negative value. The negative value is sent by referencing a formula field on the publication source object, which stores the corresponding negative value.
You can create mappings for two separate target child types, Credit and Debit.
Key |
Target Child Type |
Target Field |
---|---|---|
Name | Credit | Journal Line Item ID |
CreditValue | Credit | Value |
Name | Debit | Journal Line Item ID |
DebitValue | Debit | Value |
In this example, if you sent the following message, you would create four records.
Key |
Target Child Type |
Value |
---|---|---|
Name | Credit | Office Supplies |
CreditValue | Credit | 50 |
Name | Debit | Office Supplies |
DebitValue | Debit | -50 |
Name | Credit | Kitchen Supplies |
CreditValue | Credit | 100 |
Name | Debit | Kitchen Supplies |
DebitValue | Debit | -100 |