Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [clone]

copy details/field values from one object to another

0
votes
0answers
8 views

How to Add Toggle button and Clone| Add favourite| Delete Action Icons for a every record in records list?

I have a VF page. that page will be showing custom object quote line item records. I need show "Clone| Add favourite| Delete Action Icons" for each record which are displayed in records list view in ...
1
vote
0answers
41 views

Standard Actions and Custom clone button

I need to override the clone functionality to pre-populate certain fields on custom object that is being cloned. So I have this URL button and passed in the record being cloned as an id in the url of ...
0
votes
0answers
20 views

Clone metadata using Tooling API

I am trying to clone Lightning Aura Bundle using Tooling API. First I executed the GET from REST Explorer using Workbench by passing the component Id. And then I used the Raw Response to hit the POST ...
0
votes
0answers
41 views

Clone Lightning Component Using Apex

I have used Metadata API to read and create Lightning Component, but I am able to clone only Lightning Component which is created by me. I am not able to clone all Lightning Component. Actually, I am ...
1
vote
3answers
55 views

How do I stop this trigger from running more than once?

I'm still fairly new to Apex. Currently in our org we have a class called CommitmentProcess and a trigger called CommitmentTrigger. We use this to clone Opportunities that are up for renewal. So for ...
0
votes
0answers
45 views

Insert failed on EventRelation records

I'm working with an apex class that generates duplicates for EvenRelation records associated to new Event records (also duplicates) The problem is that when I make the insert it displays me this error:...
0
votes
0answers
50 views

Cloning of parent record and related records

I have to clone a record and its related records too. when I am cloning it for the related records only some of the fields are being populated. Here is my code: public list<sobject> ...
0
votes
0answers
92 views

Cloning an Opportunity with related products triggered by a button (Lightning)

Following a guide https://automationchampion.com/tag/clone-opportunity-with-opportunity-products/ I've created a flow that would clone an Opportunity with related products. However instead of ...
3
votes
2answers
739 views

How to use force:recordData to clone a record?

I'm trying to clone an Opportunity record with certain values changed. Below is my code (component will be launched from Lightning component action). My Component Markup <aura:component ...
3
votes
1answer
141 views

Does standard clone button excludes fields not present on pagelayout

Does standard clone button clones fields present only on the page layout and not exactly a 'obj.clone() functionality? Note: I tried clone by removing a field from pagelayout and I donot see that ...
0
votes
1answer
99 views

Deep Cloning a Product - Clone Standard Price and Custom Prices

I have created a Record Detail button to clone a Product's detail, a related list called Bill of Materials, and both the Standard PB Entry, and any Custom PB Entries. If I remove the Custom PB Entry ...
0
votes
1answer
127 views

Apex Trigger for Cloned Record - Values changing before and after insert

I have the following trigger for changing values when a record is cloned: trigger oppAutomation on Opportunity (before insert) { if(trigger.isBefore){ if(trigger.isInsert){ ...
-2
votes
1answer
78 views

Custom Clone of specific fields only using the standard form in VF [closed]

Is there a way to clone specific fields and save only when the save button is click? Only five fields should be cloned, assign new value to one field and the rest of the fields are empty. below is ...
0
votes
0answers
30 views

Clone button on Report not displaying

For some time now the clone button on the Report object has been missing in both lightning and classic. I'm trying to identify why and get it back up there since this button makes our lives so much ...
1
vote
2answers
130 views

How to mark a field as readonly when we clone a record?

I want to mark a single field as read only when I clone a record. I am not able to find which page layout is in action when we clone a record
0
votes
0answers
110 views

Redirect one opportunity to another opportunity with edit mode in lightning

I am new in lightning in m trying to clone opportunity with line item which i already achieved But now i can't open and new cloned opportunity in edit view. I can either travel to new clonned ...
0
votes
1answer
270 views

How to populate original opportunity create date on cloned opportunity

At the beginning of every year, we mass update any open opportunities that were created 2 years prior and prevent users from changing the sales stage back to an open stage. In the event that any of ...
1
vote
1answer
41 views

Cloning Opportunities Not Calculating Expected Revenue

I have an issue where upon cloning opportunities are not calculating expected revenue from original records on a sporadic basis. There seems to be little commonality in the errors outside of expected ...
1
vote
1answer
38 views

Marking the Old Version of a Record After Trigger

This is more of an implementation question than code review. I am currently using the 'clone' standard button that triggers changes on the new cloned record. However, I also have to mark the old ...
-3
votes
1answer
53 views

How to check if the logged in user has permission to view a data field in apex code?

I need to create a custom Clone button to clone only data fields in which the logged in user has view permission to (in the his assigned permission set). how do I do that using the Apex class? thanks!...
-1
votes
1answer
42 views

Why Doesn't the Clone Work on This Controller?

I'm trying to conditionally clone a record. I'm using a trigger with this, but I just get a saved record with the values my trigger passes in. I've tried putting the page reference action in the apex ...
0
votes
0answers
41 views

how to make sure the user knows and is ok with the value of 1 field during use of the (standard) clone button

Update: isClone() formula and apex method are not working for me (see comments in this post) I was thinking to use before Apex and a Validation Rule (below, not working). Would you solve this ...
5
votes
0answers
77 views

record.clone().clone() instead of .clone()?

We are using Andrew Fawcett's SObjectDataloader Library where I fixed a couple things and stumbled over odd behavior that I couldn't find valid explanation for. So in the Library, records are ...
0
votes
1answer
165 views

Clone Opportunity via Visualforce Page

Using this page I have the following apex on a visualforce page,that I want to run when a user saves the opportunity as 'won'. My questions are: 1. How do I add it as a popup when the user saves ...
0
votes
0answers
55 views

$Action.Clone not being saved

I'm using the $Action.clone as a simple command button on a VisualForce page. This works for my user account and profile as an admin. However other users can create the interim SObject but get the ...
1
vote
1answer
127 views

Trigger to prevent duplication of records not working on cloning record for the first time

One of my object is having Lookup Relationship with Account. I want a functionality where we can not allow to have 2 records with the same Name, same Related Account, and same Owner. I have tried 2 ...
2
votes
3answers
183 views

Checkbox field -

I created a custom checkbox in the opportunity box so that an email is sent out to the team whenever it is checked. Issue is that an email is sent out if someone clones that opportunity. Is there a ...
1
vote
0answers
52 views

Clone function on apex missing to copy fields [duplicate]

I've done a code to auto-renew contracts when they arrive to their renewal date. My idea is to create an exact clone of the old contract, change it's start date for the renewal date of the old ...
0
votes
2answers
46 views

how to modify LineItem fields when Clone Order With LineItems using URL hacking

I have a custom button on the order called Clone with Products. what it does: Clone the order Modify some order fields clone the LineItems Now I want to add a function to it so it will also modify ...
1
vote
1answer
1k views

Edit list of objects with a custom Lightning component?

I'm trying to figure out how to display a list of objects (and just a few certain fields) in a lightning component and expose those fields for editing. What my full app is supposed to do is clone a ...
0
votes
1answer
394 views

how to get selected opportunityLineitem by clicking on custom button in Opportunity detail

Is there any method to get selected record of opportunity line item byt clicking on custom button in opportuntiy detail page ? my requirement is : from the custom button on opportunity detail page ...
0
votes
1answer
121 views

DeepClone(false) missing documentation

I have class (v API 24) that clones a list of SObjects by calling deepClone(false) Can someone explain what the parameter means and how comes it is working if it doesn't appear on the list of ...
5
votes
1answer
202 views

How to deep clone Messaging.SingleEmailMessage?

Problem Statement I'm working on a fluent email builder, but I've hit a bit of a snag. Namely, there does not seem to be any simple way to completely clone a Messaging.SingleEmailMessage instance ...
0
votes
1answer
186 views

Query cloned records?

I have cloned some Opportunities now i want to Query Opportunities where IsClone == True. How can I achive this? List<opportunity> opportunities = [select id,Name,Contract_Start__c,...
1
vote
2answers
1k views

Copying ContentVersion Image File from one record to another with Apex

Is it possible to copy a ContentVersion image associated with one record so that the copy is associated with a different record? Code below gives me the following Execute Anonymous error.: Line: ...
0
votes
2answers
331 views

Clone User with Queues and PermissionSetAssignemnts?

I am trying to create a functionality to clone existing user, wherein i want to assign Public groups, queue and permission sets too. All the features along with profile and role id i would be ...
0
votes
1answer
308 views

Vague error message - duplicates value on record with id

It's vague error message and I have already spent several hours trying to find out what I'm doing but could not able to find the cause I'm trying to do SObject.clone and I'm not preserving the Id here ...
1
vote
1answer
571 views

Create Customize cloning , copying old to new record

UPDATE: AFter I have tried with the @Adrian approach I'm getting the following error now: |EXCEPTION_THROWN|[65]|System.DmlException: Insert failed. First exception on row 0; first error: ...
0
votes
2answers
190 views

Customizing Clone in Standard Page Layout

I'm in a need to create a custom button that will be placed on the standard page layout and that button will call to clone the record which the user is on and I could have used the standard clone ...
7
votes
2answers
771 views

Object clone does not work as expected

I have an object (not SObject!) with a member of type List, when I clone the object and add something to the list, the original record will also be modified: public class ThingToClone { public ...
1
vote
1answer
155 views

How Do I Clone An App

how do I clone an app so a few users can switch between apps using the Force.com app drop-down menu at the top-right corner. I want the same objects/functionality etc...for the cloned app. I have a ...
0
votes
4answers
977 views

Cloning a record and its children

EDITED to include apex Messages I have created a clone button on a Contact record which is designed to add another object (survey) and its child records (survey questions). My issue is that i cant ...
0
votes
0answers
1k views

custom clone button not working in salesforce Lightning

I have a requirement to create a custom clone button for "opportunity with Products". I built it through the below code : {!URLFOR($Action.Opportunity.Clone, Opportunity.Id, [ cloneli=1 ], ...
1
vote
0answers
34 views

How can I tell on the master record if it has been cloned

Is there a way to identify, with a checkbox for example, if a record has been cloned. I need to identify this on the master record, not on the record copy. I see there is the ISCLONE() but this ...
0
votes
1answer
1k views

Apex: Clone a record, then make the new record the Parent of the old cloned Record

Scenario: Our company needs to preserve old "Abandoned" cases (due to employee departure, etc) for tracking/metrics purposes, but also need to be able to "Transfer" the cases to a new employee. ...
1
vote
0answers
227 views

How to determine if record is being cloned when using lightning experience?

These methods are not working when using Lightning Experience getCloneSourceId() and isClone() so we like to know if there is a working to determine is a record is being cloned using Lightning.
6
votes
1answer
434 views

Does sObject IsClone() only works in Classic Aloha interface but not in Lightning Experience?

I've created an Apex trigger on CustomObject_A__c, it is working fine when I clone a record in Classic Aloha interface, but the trigger does not return True for isClone() sObject function call, when I ...
1
vote
2answers
1k views

Attachment Cloning: System.LimitException: Query of LOB fields caused heap usage to exceed limit

So I am trying to clone ~11000 attachments over to new object records. I have developed the code below with help from this community and I have tested it on a sandbox with 3 attachments to move over. ...
1
vote
2answers
50 views

Cloning attachment to new object: Initial term of field expression must be a concrete SObject: List<Id>

So I am working on the code below to migrate the attachments of an old object to a new object. I have scraped the web for code that could do this. I am stuck though on this specific for loop: for(...
5
votes
1answer
4k views

Clone list of SObject records using deepClone() to clone all the fields on records

I am trying to clone the records of a custom object. I know that I can use the deepClone() method of the List class to do this. List<MyCustomObject__c> originalList = [Select Id, Name, Age From ...