A Lightning Component to clone an opportunity record with it's related opportunity line items. I came across many questions regarding this feature on Success Community and Salesforce product team still need some time to delivering this well needed feature. So, It made me think to create one and distribute this in the community.
- Sandbox Package Link
- Production/Developer Package Link
- Now, you can update cloned opportunity record
- Add/Remove columns in the add product layout (2nd Screen)
- Sandbox Package Link
- Production/Developer Package Link
- Now, you can update cloned opportunity
- Add/Remove columns in the add product layout
- Sandbox Package Link
- Developer Package Link
- Sandbox Package Link
- Production/Developer Package Link
My Domain should be enabled in your orginzation.
You can can check the GitHub Repository for the source code and can make any adjustments as per your need.
-
- You will have to go to the page layout where you want to add the lightning action. Navigate to Setup and click on Object Manager tab. Search for the Opportunity and click on the Opportunity link.
- Click on Page Layouts link in the left side panel. Edit the desired page layout and look for the lightning action "Clone with Product" and drag that action and drop in the pane.
-
- Go to Setup
- Search for Custom Metadata Type in Quick Find box
- Click on Manage Records link next to Clone Opportunity Setting
- Click on New button to add new column on Cloned Product Layout. Label should be exactly same as the Field API Name which you wants to add You will see several checkboxes and their use is explained below - Editable - Make the fields editable in the column Cloneable - If you don't want to show the field on the layout but still want that to be cloned Sortable - Make the column sortable Required - Make the field required on the product layout