Configure config.json for DMO-to-DMO Transforms (Beta)
For DMO-to-DMO transforms (transforms that read from and write to data model objects), don't use the datacustomcode scan command as you must pass the DMO schema. Instead, follow the schema standards to configure the config.json file manually.
Code extension is a pilot or beta service that is subject to the Beta Services Terms at Agreements - Salesforce.com or a written Unified Beta Agreement if executed by Customer, and applicable terms in the Product Terms Directory. Use of this pilot or beta service is at the Customer's sole discretion.
This schema example demonstrates the structure of a config.json file for DMO-to-DMO transforms:
Your config.json file must include these root-level properties.
| Property | Required | Description |
|---|---|---|
entryPoint | Yes | The main script file that is executed when your custom code is run |
dataspace | Yes | The dataspace to which the DMOs you read and write to belong (typically "default") |
permissions | Yes | Read and write permissions for data objects |
dataObjects | Yes | Required when writing to DMOs |
The permissions object defines which data model objects your script reads from and writes to. It must follow this schema structure.
Schema Requirements:
- Include both
readandwritepermissions. - Use
dmofor data model objects. - Use different object names for read and write operations.
- Every DMO in the write list must have a corresponding schema definition in
dataObjects. You don't have to define schemas for DMOs in the read list.
The dataObjects array contains schema definitions for each output DMO that your script writes to. Each object in the array defines the complete structure of a data model object, including its fields, data types, and primary keys.
Each object in the dataObjects array represents one data model object and must include these properties.
| Property | Required | Type | Description |
|---|---|---|---|
name | Yes | String | DMO name. Must match a name in permissions.write.dmo. |
category | Yes | String | Set to "profile" (case-insensitive). |
fields | Yes | Array | Array of field definitions. Include at least one field. |
label | No | String | Human-readable label |
type | No | String | "dataModelObject" |
description | No | String | Description of the DMO |
Each field in the fields array defines a property of the data model object. Each field must include these properties.
| Property | Required | Type | Description |
|---|---|---|---|
name | Yes | String | Field name. Can’t be blank. |
dataType | Yes | String | Data type. Can’t be blank. |
isPrimaryKey | Yes | Boolean | Whether this field is a primary key |
label | No | String | Human-readable label |
keyQualifierFieldName | No | String | Name of the key qualifier field |
Use these data type values in the dataType property for your DMO fields.
text- Text or string valuesemail- Email addressesdateTime- Date and time valuesnumber- Numeric valuesboolean- True or false values
When defining primary keys for your DMO, use keyQualifierFieldName to reference another field that provides more context for the primary key.
The keyQualifierFieldName references another field in your schema that provides more context for the primary key.
If your script writes to multiple DMOs, define a schema for each one in the dataObjects array. Each DMO must have its own object definition with a complete field schema.
This example shows a complete config.json file that follows all the required schema standards for a DMO-to-DMO transform.
Your config.json file must meet these validation requirements.
- Read and write permissions must not be empty.
- Dataspace must not be blank.
- Don't read and write the same object.
dataObjectsmust be present and not empty.- Every DMO in
permissions.write.dmomust have a matching schema indataObjects. - Each object's
namemust not be blank. - Each object's
categorymust be "profile". - Each object must have at least one field.
- Each field's
namemust not be blank. - Each field's
dataTypemust not be blank. isPrimaryKeymust be specified for each field.
These errors occur during package validation when your config.json doesn't follow the required schema standards.
| Error Message | Solution |
|---|---|
| No DMO schema found | Add dataObjects array with schemas for all write DMOs |
| Some DMO write targets do not have a schema | Ensure all DMO names in write.dmo have matching entries in dataObjects |
| Invalid DMO Schema: name missing | Add name property to data object |
| Invalid DMO Schema: invalid object category | Set category to "profile" |
| Invalid DMO fields schema | Ensure all fields have name and dataType |
| Can't read and write from/to the same entity | Use different DMO names for read vs write |
Currently, all these validation errors surface to the Connect API as error code 2999 ("Unknown error occurred"). The specific error messages preceding are available in logs for debugging.
- Start with Write targets: List all DMOs you write to in
permissions.write.dmo. - Create matching schemas: Make sure that each DMO has a corresponding entry in
dataObjectswith the same name. - Define all output fields: Include all fields that your script writes.
- Set the Primary Keys correctly: Identify primary keys and mark them with
isPrimaryKey: true. - Match your script output: Ensure field names match what your Python script produces.
- Use descriptive labels: While optional, labels improve readability and debugging.