This project aims to facilitate the cloning of Orchestration Plans in Salesforce. The provided Apex class allows for the creation of a new Orchestration Plan with a specified name and the cloning of associated child records.
- Clone an existing Orchestration Plan.
- Copy child records associated with the Orchestration Plan, including:
- Orchestration Scenarios
- Orchestration Plan Definitions
- Orchestration Item Definitions
- Orchestration Item Dependency
- Clone the repository.
- Deploy the provided Apex class (
CloneOrchestrationScenario.cls
) to your Salesforce environment. - Deploy the Lightning Web Component (LWC)
cloneOrchestrationPlan
andproductPicker
- Ensure necessary permissions for the executing user to perform cloning and insertion operations.
- Add the LWC component to the Orchestration Scenario flexipage:
- Navigate to Setup in your Salesforce org.
- Go to the Object Manager and find
Orchestration Scenario
. - Open the
Lightning Record Pages
section. - Edit the flexipage that your Orchestration Scenario uses.
- Drag and drop the
cloneOrchestrationPlan
component onto the flexipage in the desired location. - Save the flexipage.
Now, when viewing an Orchestration Scenario, the cloneOrchestrationPlan
component should be visible and can be used for easy interaction with the cloned Orchestration Plans.
Follow these steps to clone an Orchestration Plan:
-
Navigate to the Orchestration Scenario that serves as your starting point (it should have the last Orchestration Item).
-
Click on the 'Go to Cloning Setup' button provided by the added Lightning Web Component (LWC).
-
The script will automatically identify all related Orchestration Scenarios.
-
For each identified Orchestration Scenario, enter the new name and select the destination product.
-
Click the 'Clone Plan' button to initiate the cloning process.