Duplicate Object Trees (Related Records)

Introduction

When duplicating a record, you may also need to copy its related records to maintain data consistency. Instead of manually recreating linked records, you can configure your form to automatically duplicate related records when duplicating a parent record.

This is particularly useful for:

  • Order Management: Duplicating a customer order along with its associated order items when creating a new quote variation.

  • Project Planning: Copying a project along with its linked tasks to start a similar project.

  • Invoice Processing: Creating a duplicate invoice while maintaining the associated line items.

By enabling related duplication in the form settings, you can ensure that linked records are included in the duplication process, saving time and reducing errors.

How It Works

By default, duplicating a record only creates a copy of that specific record. To duplicate both the record and its related data, you must enable related duplication in the duplication settings in form or model.

Example: Duplicating an Order with Order Items

Let’s say you need to duplicate a Customer Order along with its Order Items. Without configuration, duplicating the order will only create a copy of the customer order record without any of the original’s order items. By enabling related duplication in the form settings, you can ensure that the new copy of the customer order includes a copy of all its associated order items.

To ensure that related records (e.g., Order Items) are duplicated when duplicating a parent record (e.g., Order), follow these steps:

  1. Open the Form for the dataset that includes a link to the parent record (e.g., Order Item Form, which links to an Order).

  2. Locate the control that connects to the parent record (e.g., the Order field in Order Item).

  3. Under Control Settings, navigate to the Data section. Duplication settings are an advanced feature so it is collapsed/hidden by default. Expand it.

 

Replaced Image
  1. In the Duplication Behavior settings:

    • Enable "Allow Duplication of This Object When the Linked Object is Duplicated."

    • Set a "Limit Number of Duplicates" to control how many related records can be duplicated with the parent. If the number of related records exceeds this limit, the duplication will fail.

You can also configure this setting directly in the Data Schema.

Step 2: Duplicate an Order with Order Items

Once related duplication is enabled, duplicating an Order will automatically include its associated Order Items.

  1. Open an Order Record in Form View.

  2. Click Duplicate icon Replaced Image

  3. In the Duplicate pop-up window, select “This and Related Records” to ensure Order Items are duplicated along with the Order. If you always want to duplicate Order Items together with the Order, enable this option. Next time, this step will be skipped automatically.

 

Replaced Image
  1. Click OK to create a copy of the record.

  2. Make any necessary changes to the duplicated record, then click Submit Copy to save it.

The system will generate a new Order with identical Order Items, saving time and reducing manual data entry.

Takeaway

Enabling automatic duplication of linked records ensures efficiency and accuracy, making it easier to replicate structured data without additional manual work. This feature is especially useful for businesses managing complex datasets, ensuring seamless duplication while maintaining data integrity.