Deep Copy Setup

This feature has been deprecated and is no longer supported. Use the FXL Deep Copy Lightning component.

Introduction

The Deep Copy feature is available in FieldFX Back Office.

Use Deep Copy to add a new record by copying an existing record and its related items.

Prerequisites

To setup and use the Deep Copy feature, you need to:

Have these user licenses Have these permissions Complete these tasks
and review these topics
before continuing
  • Minimum permissions for the FieldFX modules you are using

  • System permissions:

    • Customize Application

    • Manage Profiles and Permission Sets

    • View Setup and Configuration

Performance of Deep Copy depends on various factors including, but not limited to, the number of

  • Individual records that must copy

    • For example, each ticket and ticket item for a job

  • Other processes or integrations also running on the org

  • processes running for other orgs on your Salesforce instance

How Deep Copy Works

You can set up Deep Copy on any FieldFX object.

You can’t set up Deep Copy on Salesforce objects.
Due to a recent technical fix, Deep Copy has been updated to be more malleable and allows an underlying process to run as schedule-able or turn it off completely. This helps prevent UNABLE_TO_LOCK_ROW errors for customers that run several concurrent deep copy processes within their orgs.

By default, records deep copy asynchronously (one record at a time).

When you add a new record using Deep Copy:

  • <Copy> displays at the end of the new record name.

    Chemical Cleaning Job <Copy>

  • The new record has a new Tracking Number (if applicable).

  • The new record is in the status that has Initial Status Console selected (if applicable).

  • The following items don’t copy to the new record:

Deep Copy vs. Clone

The Deep Copy feature copies existing records and their child items.

The Clone feature copies existing records but doesn’t copy child items.

Configuration Options

You have these options for configuration:

Excluding Fields from Copying

You can exclude fields from copying to new records by adding them to a CloneBlackoutFields field set.

When you add fields to a CloneBlackoutFields field set:

  • Unique values in those fields don’t copy to new records

  • Default values for those fields do copy to new records

By default, Deep Copy never copies data from the following fields:

  • Id fields

  • External ID fields

  • Status fields

  • SyncID fields

  • Tracking Number fields

  • Auto Number fields

  • Formula fields

  • Invoice Item fields on ticket items

  • Job lookups on ticket items

Dry Run Mode

Use the Dry Run mode to see what data will copy without actually copying anything.

This mode is ideal for testing new functionality and troubleshooting issues.

To use Dry Run mode, add &dryrun=1 to the end of the URL used for the Deep Copy button:

/apex/FX5__sObjectEntityCloner?Id={!FX5__Job__c.Id}&cloningtypes=FX5__Ticket__c,FX5__Ticket_Item__c&dryrun=1

Synchronous Mode

Use the Synchronous mode to deep copy records synchronously (at the same time).

This mode is ideal for deep copying small items, such as tickets.

To use Synchronous mode, add &sync to the end of the URL used for the Deep Copy button:

/apex/FX5__sObjectEntityCloner?Id={!FX5__Job__c.Id}&cloningtypes=FX5__Ticket__c,FX5__Ticket_Item__c&sync

Filters

You can use checkbox, status, or crew planning filters.

Use filters to exclude records meeting criteria from copying.

Following are some examples.

Checkbox Filter

Use the following filter when you copy price books.

This filter prevents archived price book items from copying.

To use this filter, add {FX5__IsArchived__c=false} to the URL used for the Deep Copy button:

/apex/FX5__sObjectEntityCloner?Id={!FX5__Price_Book__c.Id}&cloningtypes=FX5__Price_Book_Item__c{FX5__IsArchived__c=false}

Status Filter

Use the following filter when you copy tickets for jobs.

This filter prevents tickets in the "In Progress" status from copying.

To use this filter, add {FX5__Status__r.Name!=%27In Progress%27} to the URL used for the Deep Copy button:

/apex/FX5__sObjectEntityCloner?Id={!FX5__Job__c.Id}&cloningtypes=FX5__Ticket__c{FX5__Status__r.Name!=%27In Progress%27},FX5__Ticket_Item__c

Crew Planning Filter

Use the following filter when you copy crew planning records for jobs.

This filter prevents duplicate crew planning records getting added if you have AutoAddJobCreatorToCrew selected in FX Settings.

To use this filter, add {FX5__Crew_Member__r.User__c!=%27{!$User.Id}%27 OR(FX5__Role_on_Job__c!=null OR FX5__Charge_Code__c!=null)} to the URL used for the Deep Copy button:

/apex/FX5__sObjectEntityCloner?Id={!FX5__Job__c.Id}&cloningtypes=FX5__Ticket__c,FX5__Ticket_Item__c,FX5__Equipment_Planning__c,FX5__Crew_Planning__c{FX5__Crew_Member__r.User__c!=%27{!$User.Id}%27 OR(FX5__Role_on_Job__c!=null OR FX5__Charge_Code__c!=null)}

Permissions

You need sharing access for every parent, child, and related record you want to copy.

You also need the following permissions for every object included in the copy: * Read, Create, and Edit object permissions * Read and Edit field permissions

Best Practices

  • Grant all users sharing access and permissions for records they need to copy.

  • Don’t create a master-detail relationship between two FieldFX objects that matches an existing master-detail relationship.

  • Don’t give a custom object the same name as a FieldFX object.

  • Don’t give a custom field the same name as a managed field on a FieldFX object.

  • Test Deep Copy functionality in a Sandbox before you deploy it to Production.

  • Remove the Clone button from page layouts for objects that feature a Deep Copy button.

Deep Copy for Price Books

There is a default Deep Copy configuration that copies price books along with their price book items, rules, and rule actions.

If you want to use the default Deep Copy configuration, you need to set up the default deep copy for price books.

If you want to copy different data with price books, you can set up a custom deep copy for price books.

Set Up the Default for Price Books

Set up the default deep copy for price books.

Add Deep Copy button to Price Book page layouts

  1. From Setup, enter object in the Quick Find box, then select Objects.

  2. Click Price Book.

  3. Under Page Layouts, click Edit next to a page layout for FieldFX Back Office.

  4. On the toolbar, click Buttons.

  5. Drag Deep Copy into the Custom Buttons section.

  6. Click Save.

  7. For other page layouts as needed, repeat the above steps.

Optionally Add a CloneBlackoutFields field set

You can optionally add a CloneBlackoutFields field set to select the fields to exclude from being copied.

  1. From Setup, enter object in the Quick Find box, then select Objects.

  2. Open the object with fields to exclude.

    • Open the Price Book object to exclude price book fields.

    • Open the Price Book Item object to exclude price book item fields.

    • Open the Rule object to exclude rule fields.

    • Open the Rule Action object to exclude rule action fields.

  3. Under Field Sets, click New.

  4. In Field Set Label, enter CloneBlackoutFields.

  5. In Where is this used, enter Price Book Deep Copy.

  6. Click Save.

  7. Drag the fields to exclude into the In the Field Set list.

  8. Click Save.

Grant permission to use Deep Copy

  1. From Setup, enter permission in the Quick Find box, then select Permission Sets.

  2. Open a permission set for Visualforce pages.

  3. Under Apps, click Apex Class Access.

  4. Click Edit.

  5. Add the following to Enabled Apex Classes and then click Save:

    • FX5.CloningTypeInfo

    • FX5.SObjectCloningController

    • FX5.SObjectCloner

    • FX5.SObjectClonerUtility

    • FX5.SObjectCloner_Test

    • FX5.SObjectDescribeInfo

  6. At the top of the page, click the arrow next to Apex Class Access and select Visualforce Page Access.

  7. Click Edit.

  8. Add FX5.SObjectEntityCloner to Enabled Visualforce Pages.

  9. Click Save.

  10. Repeat the other steps for other permission sets as needed.

Set Up a Custom Deep Copy for Price Books

Add Deep Copy button to Price Book object

  1. From Setup, enter object in the Quick Find box, then select Objects.

  2. Click Price Book.

  3. Under Buttons, Links, and Actions, click New Button or Link.

  4. In Label, enter a name for the button.

  5. In Display Type, select Detail Page Button.

  6. In Behavior, select "Display in new window".

  7. In Content Source, select "URL".

  8. In the URL field, enter code to specify the data to copy:

    • Enter the following to copy an existing price book and its price book items:

      /apex/FX5__sObjectEntityCloner?Id={!FX5__Price_Book__c.Id}&cloningtypes=FX5__Price_Book_Item__c
    • To prevent data from being copied, remove the object from the cloningtypes=.

  9. Click Save.

  10. Click OK.

  11. Click Back to Custom Object: Price Book at the top of the page.

  12. Continue with Add Deep Copy button to Price Book page layouts.

Add Deep Copy button to Price Book page layouts

  1. Under Page Layouts, click Edit next to a page layout for FieldFX Back Office.

  2. On the toolbar, click Buttons.

  3. Drag the Deep Copy button into the Custom Buttons section.

  4. Click Save.

  5. Repeat the above steps to other page layouts as needed.

  6. You can optionally add a CloneBlackoutFields field set or Grant permission to use Deep Copy.

Optionally Add a CloneBlackoutFields field set

You can optionally add a CloneBlackoutFields field set to select the fields to exclude from being copied.

  1. From Setup, enter object in the Quick Find box, then select Objects.

  2. Open the object with fields to exclude.

    • Open the Price Book object to exclude price book fields.

    • Open the Price Book Item object to exclude price book item fields.

  3. Under Field Sets, click New.

  4. In Field Set Label, enter CloneBlackoutFields.

  5. In Where is this used, enter Price Book Deep Copy.

  6. Click Save.

  7. Drag the fields to exclude into the In the Field Set list.

  8. Click Save.

  9. Continue with Grant permission to use Deep Copy.

Grant permission to use Deep Copy

  1. From Setup, enter permission in the Quick Find box, then select Permission Sets.

  2. Open a permission set for Visualforce pages.

  3. Under Apps, click Apex Class Access.

  4. Click Edit.

  5. Add the following to Enabled Apex Classes and then click Save:

    • FX5.CloningTypeInfo

    • FX5.SObjectCloningController

    • FX5.SObjectCloner

    • FX5.SObjectClonerUtility

    • FX5.SObjectCloner_Test

    • FX5.SObjectDescribeInfo

  6. At the top of the page, click the arrow next to Apex Class Access and select Visualforce Page Access.

  7. Click Edit.

  8. Add FX5.SObjectEntityCloner to Enabled Visualforce Pages.

  9. Click Save.

  10. If other permission sets are needed, repeat the above steps.

Deep Copying a Price Book

  1. Access FieldFX Back Office.

  2. Switch to Salesforce Classic.

  3. Open the Price Books tab.

    Open the Price Books tab that uses the following icon:

    Screen capture of the pRice Books tab in Salesforce Classic

  4. Open the price book.

  5. Click Deep Copy.

    The deep copy begins and a new window displays:

    • Don’t navigate back to the previous page in the browser once you start a deep copy.

    • Don’t deep copy more than one price book at once.

    • You will receive email confirmation once the deep copy finishes.

<Copy> displays at the end of the new price book name.

For example: 2016 Price List <Copy>

Deep Copy for Quotes

Set Up for Quotes

Add the Deep Copy button to the Quote object

  1. From Setup, enter object in the Quick Find box, then select Objects.

  2. Click Quote.

  3. Under Buttons, Links, and Actions, click New Button or Link.

  4. In Label, enter Deep Copy.

  5. In Display Type, select Detail Page Button.

  6. In Behavior, select "Display in new window".

  7. In Content Source, select "URL".

  8. In the URL field, enter code to specify the data to copy:

    • Enter the following to copy an existing quote and its quote items:

      /apex/FX5__sObjectEntityCloner?Id={!FX5__Quote__c.Id}&cloningtypes=FX5__Quote_Item__c
    • To prevent data from being copied, remove the object from the cloningtypes=.

  9. Click Save.

  10. Click OK.

  11. Click Back to Custom Object: Quote at the top of the page.

  12. Continue with Add the Deep Copy button to Quote page layouts.

Add the Deep Copy button to Quote page layouts

  1. Under Page Layouts, click Edit next to a page layout for FieldFX Back Office.

  2. On the toolbar, click Buttons.

  3. Drag Deep Copy into the Custom Buttons section.

  4. Click Save.

  5. If needed for other page layouts, repeat the above steps.

  6. You can optionally add a CloneBlackoutFields field set or continue with Grant Permission to Use Deep Copy.

(Optional) Add a CloneBlackoutFields field set

You can optionally add a CloneBlackoutFields field set to exclude fields from being copied.

  1. From Setup, enter object in the Quick Find box, then select Objects.

  2. Open the object with fields to exclude.

    Open the Quote object to exclude quote fields.

    Open the Quote Item object to exclude quote item fields

  3. Under Field Sets, click New.

  4. In Field Set Label, enter CloneBlackoutFields.

  5. In Where is this used, enter Quote Deep Copy.

  6. Click Save.

  7. Drag the fields to exclude into the In the Field Set list.

  8. Click Save.

  9. Continue with Grant Permission to Use Deep Copy.

Grant Permission to Use Deep Copy

  1. From Setup, enter permission in the Quick Find box, then select Permission Sets.

  2. Open a permission set for Visualforce pages.

  3. Under Apps, click Apex Class Access.

  4. Click Edit.

  5. Add the following to Enabled Apex Classes:

    • FX5.CloningTypeInfo

    • FX5.SObjectCloningController

    • FX5.SObjectCloner

    • FX5.SObjectClonerUtility

    • FX5.SObjectCloner_Test

    • FX5.SObjectDescribeInfo

  6. Click Save.

  7. At the top of the page, click the arrow next to Apex Class Access and select Visualforce Page Access.

  8. Click Edit.

  9. Add FX5.SObjectEntityCloner to Enabled Visualforce Pages:

  10. Click Save.

  11. If needed for other permission sets, repeat the above steps.

Deep Copying a Quote

  1. Access FieldFX Back Office.

  2. Switch to Salesforce Classic.

  3. Open the Quotes tab.

  4. Open the quote.

  5. Click Deep Copy.

    • The deep copy begins and a new window displays:

      • Don’t navigate back to the previous page in the browser once you start a deep copy.

      • Don’t deep copy more than one quote at once.

      • You will receive email confirmation once the deep copy finishes.

    • Notice the following:

      • The new quote is in the status that has Initial Status Console selected.

      • The new quote has a new Quote Id and Tracking Number.

Deep Copy for Jobs

When using Deep Copy for Jobs, you need to set up and deep copy the job.

Set up Deep Copy for Jobs

Add the Deep Copy button to the Job Object

  1. From Setup, enter object in the Quick Find box, then select Objects.

  2. Click Job.

  3. Under Buttons, Links, and Actions, click New Button or Link.

  4. In Label, enter Deep Copy.

  5. In Display Type, select Detail Page Button.

  6. In Behavior, select "Display in new window".

  7. In Content Source, select "URL".

  8. In the URL field, enter code to specify the data to copy:

    • Enter the following to copy an existing job and its tickets and ticket items:

      /apex/FX5__sObjectEntityCloner?Id={!FX5__Job__c.Id}&cloningtypes=FX5__Ticket__c,FX5__Ticket_Item__c
    • Enter the following to copy an existing job and its tickets and ticket items, crew planning records, and equipment planning records:

      /apex/FX5__sObjectEntityCloner?Id={!FX5__Job__c.Id}&cloningtypes=FX5__Ticket__c,FX5__Ticket_Item__c,FX5__Equipment_Planning__c,FX5__Crew_Planning__c{FX5__Crew_Member__r.User__c!=%27{!$User.Id}%27 OR(FX5__Role_on_Job__c!=null OR FX5__Charge_Code__c!=null)}
      • To copy FX Forms, add the API name of the FX Form object to the cloningtypes=.

      • To prevent data from being copied, remove the object from the cloningtypes=.

      • You can’t use Deep Copy to copy checklists. Therefore, don’t add FX5__Checklist__c, FX5__Checklist_Step__c, or FX5__Ticket_Checklist_Step to the cloningtypes=.

      • Add the {Crew_Member__r.User__c!=%27{!$User.Id}%27 OR (Role_on_Job__c!=null OR Charge_Code__c!=null)} filter after FX5__Crew_Planning__c to prevent duplicate crew planning records getting added for record owners.

  9. Click Save.

  10. Click OK.

  11. Click Back to Custom Object: Job at the top of the page.

  12. Continue with Add the Deep Copy button to Job page layouts.

Add the Deep Copy button to Job page layouts

  1. Under Page Layouts, click Edit next to a page layout for FieldFX Back Office.

  2. On the toolbar, click Buttons.

  3. Drag Deep Copy into the Custom Buttons section.

  4. Click Save.

  5. If needed for other page layouts, repeat the above steps.

  6. You can also Optionally Add a CloneBlackoutFields Field Set or continue with Grant Permission to use Deep Copy.

Optionally Add a CloneBlackoutFields Field Set

Add a CloneBlackoutFields field set to exclude fields from being copied.

  1. From Setup, enter object in the Quick Find box, then select Objects.

  2. Open the object with fields to exclude:

    • Open the Job object to exclude job fields.

    • Open the Ticket object to exclude ticket fields.

    • Open the Ticket Item object to exclude ticket item fields.

  3. Under Field Sets, click New.

  4. In Field Set Label, enter CloneBlackoutFields.

  5. In Where is this used, enter Job Deep Copy.

  6. Click Save.

  7. Drag the fields to exclude into the In the Field Set list.

  8. Click Save.

  9. Continue with Grant Permission to use Deep Copy.

Grant Permission to use Deep Copy

  1. From Setup, enter permission in the Quick Find box, then select Permission Sets.

  2. Open a permission set for Visualforce pages.

  3. Under Apps, click Apex Class Access.

  4. Click Edit.

  5. Add the following to Enabled Apex Classes:

    • FX5.CloningTypeInfo

    • FX5.SObjectCloningController

    • FX5.SObjectCloner

    • FX5.SObjectClonerUtility

    • FX5.SObjectCloner_Test

    • FX5.SObjectDescribeInfo

  6. Click Save.

  7. At the top of the page, click the arrow next to Apex Class Access and select Visualforce Page Access.

  8. Click Edit.

  9. Add FX5.SObjectEntityCloner to Enabled Visualforce Pages.

  10. Click Save.

  11. If other permission sets are needed, repeat the above steps.

Deep Copying a Job

  1. Access FieldFX Back Office.

  2. Switch to Salesforce Classic.

  3. Open the Jobs tab.

  4. Open the job.

  5. Click Deep Copy.

    • The deep copy begins and a new window displays:

      • Don’t navigate back to the previous page in the browser once you start a deep copy.

      • Don’t deep copy more than one job at once.

      • You will receive email confirmation once the deep copy finishes.

    • Notice the following:

      • <Copy> displays at the end of the new job name.

        Example 1. Sample copied job name

        Chemical Cleaning Job <Copy>

      • The new job is in the status that has Initial Status Console selected.

      • The new job has a new Tracking Number.

Deep Copy for Tickets

Set Up Deep Copy for Tickets

Add Deep Copy button to Ticket object

  1. From Setup, enter object in the Quick Find box, then select Objects.

  2. Click Ticket.

  3. Under Buttons, Links, and Actions, click New Button or Link.

  4. In Label, enter Deep Copy.

  5. In Display Type, select Detail Page Button.

  6. In Behavior, select "Display in new window".

  7. In Content Source, select "URL".

  8. In the URL field, enter code to specify the data to copy:.

    • Enter the following to copy an existing ticket and its ticket items:

      /apex/FX5__sObjectEntityCloner?Id={!FX5__Ticket__c.Id}&cloningtypes=FX5__Ticket_Item__c
    • Tips

      • To copy FX Forms, add the API name of the FX Form object to the cloningtypes=.

      • To prevent data from being copied, remove the object from the cloningtypes=.

      • You can’t use Deep Copy to copy checklists.
        Therefore, don’t add FX5__Checklist__c, FX5__Checklist_Step__c, or FX5__Ticket_Checklist_Step__c to the cloningtypes=.

  9. Click Save.

  10. Click OK.

  11. Click Back to Custom Object: Ticket at the top of the page.

  12. Continue with Add Deep Copy button to Ticket page layouts.

Add Deep Copy button to Ticket page layouts

  1. Under Page Layouts, click Edit next to a page layout for FieldFX Back Office.

  2. On the toolbar, click Buttons.

  3. Drag Deep Copy into the Custom Buttons section.

  4. Click Save.

  5. For other page layouts if needed, repeat the above steps.

  6. You can optionally add a CloneBlackoutFields field set.

Optionally Add a CloneBlackoutFields field set

You can optionally add a CloneBlackoutFields field set to exclude fields from being copied.

  1. From Setup, enter object in the Quick Find box, then select Objects.

  2. Open the object with fields to exclude.

    • Examples

      • Open the Ticket object to exclude ticket fields.

        The Ticket object has a default CloneBlackoutFields field set that excludes Created in Mobile and Checklist Name from being copied. Add a second CloneBlackoutFields field set to exclude other fields.

      • Open the Ticket Item object to exclude ticket item fields.

  3. Under Field Sets, click New.

  4. In Field Set Label, enter CloneBlackoutFields.

  5. In Where is this used, enter Ticket Deep Copy.

  6. Click Save.

  7. Drag the fields to exclude into the In the Field Set list.

  8. Click Save.

  9. Continue with Grant Permission to Use Deep Copy.

Grant Permission to Use Deep Copy

  1. From Setup, enter permission in the Quick Find box, then select Permission Sets.

  2. Open a permission set for Visualforce pages.

  3. Under Apps, click Apex Class Access.

  4. Click Edit.

  5. Add the following to Enabled Apex Classes:

    • FX5.CloningTypeInfo

    • FX5.SObjectCloningController

    • FX5.SObjectCloner

    • FX5.SObjectClonerUtility

    • FX5.SObjectCloner_Test

    • FX5.SObjectDescribeInfo

  6. Click Save.

  7. At the top of the page, click the arrow next to Apex Class Access and select Visualforce Page Access.

  8. Click Edit.

  9. Add FX5.SObjectEntityCloner to Enabled Visualforce Pages.

  10. Click Save.

  11. If other permission steps are needed, repeat the above steps.

Deep Copying a Ticket

  1. Access FieldFX Back Office.

  2. Switch to Salesforce Classic.

  3. Open the Tickets tab.

  4. Open the ticket.

  5. Click Deep Copy.

    • The deep copy begins and a new window displays:

      • Don’t navigate back to the previous page in the browser once you start a deep copy.

      • Don’t deep copy more than one ticket at once.

      • You will receive email confirmation once the deep copy finishes.

    • Notice the following:

      • The new ticket is in the status that has Initial Status Console selected.

      • The new ticket has a new Ticket ID and Tracking Number.