Deep Copy Setup
Prerequisites
-
To set up or use the Deep Copy feature, you need the following licenses:
-
To set up the Deep Copy feature, you must:
-
To set up the Deep Copy feature, you need:
-
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
|
Basics
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.
Consider using the FXL Deep Copy Lightning component instead. |
How it Works
You can set up Deep Copy on any FieldFX object.
You can’t set up Deep Copy on Salesforce objects. |
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
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
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
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
Basic
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.
Setting Up the Default Deep Copy for Price Books
-
Add the Deep Copy button to Price Book page layouts
-
From Setup, enter "object" in the Quick Find box, then select Objects
-
Click Price Book
-
Under Page Layouts, click Edit next to a page layout for FieldFX Back Office
-
On the toolbar, click Buttons
-
Drag Deep Copy into the Custom Buttons section
-
Click Save
-
Repeat steps c to f for other page layouts as needed
-
-
(Optional) Add a CloneBlackoutFields field set to select the fields to exclude from being copied
-
From Setup, enter "object" in the Quick Find box, then select Objects.
-
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.
-
-
Under Field Sets, click New.
-
In Field Set Label, enter "CloneBlackoutFields".
-
In Where is this used, enter "Price Book Deep Copy".
-
Click Save.
-
Drag the fields to exclude into the In the Field Set list.
-
Click Save.
-
-
Grant permission to use Deep Copy:
-
From Setup, enter "permission" in the Quick Find box, then select Permission Sets
-
Open a permission set for Visualforce pages
-
Under Apps, click Apex Class Access
-
Click Edit
-
Add the following to Enabled Apex Classes:
-
FX5.CloningTypeInfo
-
FX5.SObjectCloningController
-
FX5.SObjectCloner
-
FX5.SObjectClonerUtility
-
FX5.SObjectCloner_Test
-
FX5.SObjectDescribeInfo
-
-
Click Save
-
At the top of the page, click the arrow next to Apex Class Access and select Visualforce Page Access
-
Click Edit
-
Add the following to Enabled Visualforce Pages:
-
FX5.SObjectEntityCloner
-
-
Click Save
-
Repeat steps a to j for other permission sets as needed
-
Setting Up a Custom Deep Copy for Price Books
-
Add a Deep Copy button to the Price Book object:
-
From Setup, enter "object" in the Quick Find box, then select Objects
-
Click Price Book
-
Under Buttons, Links, and Actions, click New Button or Link
-
In Label, enter a name for the button
-
In Display Type, select Detail Page Button
-
In Behavior, select "Display in new window"
-
In Content Source, select "URL"
-
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=
.
-
-
Click Save
-
Click OK
-
Click Back to Custom Object: Price Book at the top of the page
-
-
Add the Deep Copy button to Price Book page layouts:
-
Under Page Layouts, click Edit next to a page layout for FieldFX Back Office
-
On the toolbar, click Buttons
-
Drag the Deep Copy button into the Custom Buttons section
-
Click Save
-
Repeat steps a to d to other page layouts as needed
-
-
(Optional) Add a CloneBlackoutFields field set to select the fields to exclude from being copied:
-
From Setup, enter "object" in the Quick Find box, then select Objects
-
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.
-
-
Under Field Sets, click New
-
In Field Set Label, enter "CloneBlackoutFields"
-
In Where is this used, enter "Price Book Deep Copy"
-
Click Save
-
Drag the fields to exclude into the In the Field Set list
-
Click Save
-
-
Grant permission to use Deep Copy:
-
From Setup, enter "permission" in the Quick Find box, then select Permission Sets
-
Open a permission set for Visualforce pages
-
Under Apps, click Apex Class Access
-
Click Edit
-
Add the following to Enabled Apex Classes:
-
FX5.CloningTypeInfo
-
FX5.SObjectCloningController
-
FX5.SObjectCloner
-
FX5.SObjectClonerUtility
-
FX5.SObjectCloner_Test
-
FX5.SObjectDescribeInfo
-
-
Click Save
-
At the top of the page, click the arrow next to Apex Class Access and select Visualforce Page Access
-
Click Edit
-
Add the following to Enabled Visualforce Pages
-
FX5.SObjectEntityCloner
-
-
Click Save
-
Repeat steps a to j for other permission sets as needed
-
Deep Copying a Price Book
-
Open the Price Books tab
Open the Price Books tab that uses the following icon:
-
Open the price book
-
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.
-
For example: |
Deep Copy for Quotes
Setting up Deep Copy for Quotes
-
Add the Deep Copy button to the Quote object:
-
From Setup, enter "object" in the Quick Find box, then select Objects
-
Click Quote
-
Under Buttons, Links, and Actions, click New Button or Link
-
In Label, enter "Deep Copy"
-
In Display Type, select Detail Page Button
-
In Behavior, select "Display in new window"
-
In Content Source, select "URL"
-
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=
.
-
-
Click Save
-
Click OK
-
Click Back to Custom Object: Quote at the top of the page
-
-
Add the Deep Copy button to Quote page layouts:
-
Under Page Layouts, click Edit next to a page layout for FieldFX Back Office
-
On the toolbar, click Buttons
-
Drag Deep Copy into the Custom Buttons section
-
Click Save
-
Repeat steps a to d for other page layouts as needed
-
-
(Optional) Add a CloneBlackoutFields field set to exclude fields from being copied:
-
From Setup, enter "object" in the Quick Find box, then select Objects
-
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
-
Under Field Sets, click New
-
In Field Set Label, enter "CloneBlackoutFields"
-
In Where is this used, enter "Quote Deep Copy"
-
Click Save
-
Drag the fields to exclude into the In the Field Set list
-
Click Save
-
-
Grant permission to use Deep Copy:
-
From Setup, enter "permission" in the Quick Find box, then select Permission Sets
-
Open a permission set for Visualforce pages
-
Under Apps, click Apex Class Access
-
Click Edit
-
Add the following to Enabled Apex Classes:
-
FX5.CloningTypeInfo
-
FX5.SObjectCloningController
-
FX5.SObjectCloner
-
FX5.SObjectClonerUtility
-
FX5.SObjectCloner_Test
-
FX5.SObjectDescribeInfo
-
-
Click Save
-
At the top of the page, click the arrow next to Apex Class Access and select Visualforce Page Access
-
Click Edit
-
Add the following to Enabled Visualforce Pages:
-
FX5.SObjectEntityCloner
-
-
Click Save
-
Repeat steps a to j for other permission sets as needed
-
Deep Copying a Quote
-
Access FieldFX Back Office
-
Open the Quotes tab
-
Open the quote
-
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:
-
Deep Copy for Jobs
Setting up Deep Copy for Jobs
-
Add the Deep Copy button to the Job object:
-
From Setup, enter "object" in the Quick Find box, then select Objects
-
Click Job
-
Under Buttons, Links, and Actions, click New Button or Link
-
In Label, enter "Deep Copy"
-
In Display Type, select Detail Page Button
-
In Behavior, select "Display in new window"
-
In Content Source, select "URL"
-
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
, orFX5__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 afterFX5__Crew_Planning__c
to prevent duplicate crew planning records getting added for record owners.
-
-
-
Click Save
-
Click OK
-
Click Back to Custom Object: Job at the top of the page
-
-
Add the Deep Copy button to Job page layouts:
-
Under Page Layouts, click Edit next to a page layout for FieldFX Back Office
-
On the toolbar, click Buttons
-
Drag Deep Copy into the Custom Buttons section
-
Click Save
-
Repeat steps a to d to other page layouts as needed
-
-
(Optional) Add a CloneBlackoutFields field set to exclude fields from being copied:
-
From Setup, enter "object" in the Quick Find box, then select Objects
-
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.
-
-
Under Field Sets, click New
-
In Field Set Label, enter "CloneBlackoutFields"
-
In Where is this used, enter "Job Deep Copy"
-
Click Save
-
Drag the fields to exclude into the In the Field Set list
-
Click Save
-
-
Grant permission to use Deep Copy:
-
From Setup, enter "permission" in the Quick Find box, then select Permission Sets
-
Open a permission set for Visualforce pages.
-
Under Apps, click Apex Class Access
-
Click Edit
-
Add the following to Enabled Apex Classes:
-
FX5.CloningTypeInfo
-
FX5.SObjectCloningController
-
FX5.SObjectCloner
-
FX5.SObjectClonerUtility
-
FX5.SObjectCloner_Test
-
FX5.SObjectDescribeInfo
-
-
Click Save
-
At the top of the page, click the arrow next to Apex Class Access and select Visualforce Page Access
-
Click Edit
-
Add the following to Enabled Visualforce Pages:
-
FX5.SObjectEntityCloner
-
-
Click Save
-
Repeat steps a to j for other permission sets as needed
-
Deep Copying a Job
-
Open the Jobs tab
-
Open the job
-
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:
-
Deep Copy for Tickets
Setting Up Deep Copy for Tickets
-
Add the Deep Copy button to the Ticket object:
-
From Setup, enter "object" in the Quick Find box, then select Objects
-
Click Ticket
-
Under Buttons, Links, and Actions, click New Button or Link
-
In Label, enter "Deep Copy"
-
In Display Type, select Detail Page Button
-
In Behavior, select "Display in new window"
-
In Content Source, select "URL"
-
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 addFX5__Checklist__c
,FX5__Checklist_Step__c
, orFX5__Ticket_Checklist_Step__c
to thecloningtypes=
.
-
-
-
Click Save
-
Click OK
-
Click Back to Custom Object: Ticket at the top of the page
-
-
Add the Deep Copy button to Ticket page layouts:
-
Under Page Layouts, click Edit next to a page layout for FieldFX Back Office
-
On the toolbar, click Buttons
-
Drag Deep Copy into the Custom Buttons section
-
Click Save
-
Repeat steps a to d for other page layouts as needed
-
-
(Optional) Add a CloneBlackoutFields field set to exclude fields from being copied:
-
From Setup, enter "object" in the Quick Find box, then select Objects
-
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.
-
-
-
Under Field Sets, click New
-
In Field Set Label, enter "CloneBlackoutFields"
-
In Where is this used, enter "Ticket Deep Copy"
-
Click Save
-
Drag the fields to exclude into the In the Field Set list
-
Click Save
-
-
Grant permission to use Deep Copy:
-
From Setup, enter "permission" in the Quick Find box, then select Permission Sets
-
Open a permission set for Visualforce pages
-
Under Apps, click Apex Class Access
-
Click Edit
-
Add the following to Enabled Apex Classes:
-
FX5.CloningTypeInfo
-
FX5.SObjectCloningController
-
FX5.SObjectCloner
-
FX5.SObjectClonerUtility
-
FX5.SObjectCloner_Test
-
FX5.SObjectDescribeInfo
-
-
Click Save
-
At the top of the page, click the arrow next to Apex Class Access and select Visualforce Page Access
-
Click Edit
-
Add the following to Enabled Visualforce Pages:
-
FX5.SObjectEntityCloner
-
-
Click Save
-
Repeat steps a to j for other permissions sets
-
Deep Copying a Ticket
-
Open the Tickets tab
-
Open the ticket
-
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:
-