copy details/field values from one object to another

learn more… | top users | synonyms

1
vote
0answers
7 views

Can the pricebook be changed when cloning an opportunity with product?

I have a location field on Opportunity which is tied up with a pricebook. If I clone the Opportunity with products, it won't allow me to change the location because it's associated to that pricebook. ...
2
votes
2answers
68 views

Salesforce cloning and integration

We have multiple salesforce orgs for multiple non profits. All of them need to have same functionality but different organization. Is there a way to clone all these organization? If I make changes, ...
1
vote
1answer
28 views

Does deep cloning also create new parent record?

I am running below code Account a1 = new Account(name='a1'); insert a1; Account a2 = new Account(name='a2', parentId = a1.id); insert a2; Account a3 = new Account(name='a3', parentId = a2.Id); insert ...
2
votes
0answers
22 views

What are all the possible entry points for cloning a record?

In an org I have worked on, we needed to stop users from being able to clone a custom object record. (it just doesn't fit the business logic). To do this, I removed the "Clone" button from the page ...
0
votes
1answer
25 views

URL Redirect not working for specfic record

I have a custom button on oppty which when clicked is redirected to a VF page. The page clones existing fields and presents an edit window with prefilled fields to the user. The button works fine for ...
1
vote
2answers
51 views

Error when I try to clone an object

I'm trying to clone an object, here is the code: @RemoteAction global static void cloneRow(String idProj){ System.debug('@@ clone: '+idProj); ConfigeroPSA__Expense__c oldExp = [SELECT ...
0
votes
0answers
60 views

Deep Clone Test Class not finding newly created record

I have a deep clone class that is called from a VF page. The class executes perfectly, I just cannot get my test class to work properly. I'm trying to verify that the cloned record is created within ...
1
vote
1answer
37 views

how to handle unique fields while cloning?

I have developed below code fro cloning but unfortunately because of unique field i am getting error of duplication. here one text field set to unique. Apex class: public class ...
2
votes
2answers
28 views

Error inserting TaskRelation records

I have a client who wants the ability to clone a task that has multiple contacts. They would make slight changes to the cloned task (Assigned To, etc) but the multiple contacts would remain the same. ...
2
votes
1answer
101 views

Create Custom Cloning Button - New Admin

I am relatively new to salesforce and administration. I am trying to create a custom cloning button that checks against the user profile name. I am using URL as content source. ...
1
vote
0answers
38 views

Custom Clone button with ability to validate picklist values for Record Types

We have a custom controller for a custom clone button that also checks whether the picklist values are active on a parent record when a Case is being cloned. If any of the picklist values on the ...
0
votes
2answers
88 views

Custom Clone Button - Default values to blank

I would like to create a custom clone button on the case object that clones all of the case but I want two fields - Escalation_Stats__c, Escalation_2 to default to blank. Below is the code I am trying ...
1
vote
2answers
76 views

Clone an email using the API: the email attribute _AdditionalEmailAttribute1 is not copied (SFMC)

we need your valuable help on SFMC. We have a HubExchange app and a large client (millions of users) is using it and having some serious issues. They have "Web Analytics Connector" enabled, which ...
1
vote
1answer
65 views

Standard Clone Button - Setting Field Values - Custom Button Or Something Else?

Need: Ability to Clone records, and set a value into a field during the cloning. In my specific case, I want to populate either a Lookup field with the ID of the record cloned from (so passing ...
0
votes
1answer
40 views

unable to clear out email field on clone using URL hacking

I am creating a button to clone a contact record, however I don't want to clone the email field, therefore I use the following syntax: ...
1
vote
1answer
55 views

Field not writable after Database.rollback() and clone()

This is my custom save method: private void saveNewMode() { Savepoint toBeforeState = Database.setSavepoint(); try { insert parent; for(ChildA__c prs : childrenA) { ...
0
votes
1answer
89 views

Cloning on trigger is inserting record twice

we have a approval system and when every step is approved it updates Revision number. There is a trigger on the change of Revision Number, which is responsible for cloning the the existing record and ...
0
votes
1answer
96 views

Trigger to clone object is throwing error

Apex trigger is throwing following error when tried to clone the record, Although there is no id inserted but still I'm getting complain about id. **Validation Errors While Saving Record(s) There ...
0
votes
1answer
41 views

How to clone related records

I have 2 custom objects, object1(Parent) and object2(Child), i want a clone button on object1 so everytime i clone then it needs to carry over records from object2. I created this button but it ...
1
vote
1answer
116 views

Clone Dashboard with Reports

I have to clone a dashboard for multiple markets (say I have to clone a dashboard aimed at France for every country in Europe). This dashboard has about 10 underlying reports with the same filter ...
2
votes
1answer
171 views

Clear the contents of a lookup field when cloning a record

An interesting question was asked about clearing the contents of a custom lookup field when URL hacking the clone button on an opportunity. The question was deleted by the asker, but the behavior is a ...
2
votes
0answers
123 views

How to clone child records on any object with url content using standard clone button

i have tried to search a lot but not getting any solution for my problem. I would like to clone a parent object by clicking the standard clone button(Because all the fields are already prepopulated by ...
0
votes
1answer
139 views

Copying over of related lists

I have the following set up: Custom Object : Contract Custom Object: Address Object : Opportunity This is my process in the application: When a new Contract is created, a renewal Opportunity is ...
0
votes
1answer
526 views

Create custom Clone button for Quote object

I have created a custom Clone button for the Quote object to clone a quote and update the record type of the new quote. The button clones the quote with the current Record Type of the record it is ...
0
votes
1answer
170 views

Populate case clone field with email body - EmailMessage Trigger

This will be my first Apex trigger. I want to create a new case (by cloning another) when an email is sent to a case with Status = Closed. I've taken some code from a previous Stack Exchange thread to ...
0
votes
2answers
287 views

How To Clone Opportunity With Extra Related Custom Objects

Each Opportunity in our Salesforce system may have zero or more related Opportunity Items which are custom objects. The relationship and use of Opportunity and Opportunity Items is like Orders and ...
2
votes
2answers
461 views

Deep clone parent and children without using Apex - possible?

I've seen some tools like Super Clone that can do deep clone (aka clone child records), but what I am looking for is a tool that clones record and then reparents the child records. I've seen there ...
2
votes
3answers
411 views

Summer 14 and Price books

Since Summer 14 released this weekend every time I try and clone a product I get the below error message and I don’t understand what its saying? I think something changed with the price book in the ...
3
votes
3answers
519 views

Clone Account without cloning opportunities

I am testing out cloning an account, but I would like the system to not clone some to the objects/fields. For example, I would like the clone button to clone the Address, phone and other info but not ...
2
votes
1answer
169 views

How to Clone records on a pageBlockTable via Button

I'm very noob with apex and VF. My problem is: I've a pageBlockTable that shows a list of record from a Custom Object. Now I've a column of the table on which there's a button ("Clone") that should ...
8
votes
2answers
644 views

How to “deep clone including Attachments” without hitting the heap space governor limit?

I'm working on a "deep clone" Visualforce page where starting from an object, that object and its child objects and its grandparent objects and so on are cloned and that logic works fine. But any ...
1
vote
1answer
2k views

Best approach to cloning records with rollback

I have the below code which works well to clone a case record. In this scenario, we want to insert a new case and save it. But I have a new request to create sort of a quick case where we would only ...
1
vote
2answers
3k views

Updating original object using trigger after update

I have the below code, which works, but I'm a little concerned that I'm calling a method in a loop, which performs a query. Basically, the trigger looks to see if the field Auto_Close_Reopen__c is set ...
1
vote
1answer
376 views

Replicating Clone Case Function/Action using Workflow

I'm new to Salesforce and I want to have a trigger to automatically clone a case as a new case. Example, the case has been closed and the customer replied to email, I would like to keep that case ...
2
votes
1answer
303 views

Copy picklist field when cloning an object

I'm using Apex to update the value of a field in an existing record for a particular object. I got it to work by changing the existing record and upsert it. The catch is I don't want to overwrite ...
1
vote
2answers
357 views

Milestones PM Clone a Project Template from a Trigger

We have created a Project Template and need to be able to clone it when an opportunity stage changes to Closed Won. I have started a Trigger on the Opportunity object after update that checks the ...
2
votes
2answers
1k views

Database.query() default sort order

Does a Database.query() result maintain the order of the WHERE clause list I'm searching by? List<Id> myList = new List<Id>; myList.add('My Opportunity 1'); myList.add('My Opportunity ...
3
votes
3answers
469 views

Clone sObject field values from Wrapper class

I have created one wrapper class with sObject and index for sObject and im getting and setting list of wrapper to show on VF page. On VF page im showing some fields from that sObject and provided one ...
1
vote
2answers
278 views

Is it possible to Clone a quote belonging to an account into a separate account?

We already have the ability to clone a quote, but currently it can only clone the account within the same account in which it already belongs. I.E. Is it possible to clone the quote belonging to ...
0
votes
2answers
2k views

What is the quickest way to clone a custom object and make it a child\detail to another custom object?

I am trying to essentially re-create a custom object and then make the new copy a child to the original object. What is the quickest way to do this ? I have looked into it on App Exchange but it ...
6
votes
2answers
2k views

Cloning a Wrapper Object in APEX

public class controllerName { public class WrapperClass { public CustomSObj__c custom {get; set;} public Boolean bool {get; set;} public WrapperClass(CustomSObjc__c custom) ...
1
vote
1answer
512 views

How to clone an Opportunity with null required fields

I would like to Clone an Opportunity with required fields (enforced by validation rules) which have not yet been populated. It is therefore giving the users an error when they attempt to Clone on that ...
9
votes
6answers
6k views

Deep Clone (Parent -> Child -> Grand Child)

I have a requirement to deep clone (Parent -> Child -> Grand Child) records by clicking a button at the Parent Level. I believe Salesforce supports only Clone at the Parent Level, it does not have ...
0
votes
1answer
174 views

object Name being replaced with object ID

So, the relevant snippets of code are: function doFunction(choice) { switch (choice) { case "changename": ...
2
votes
2answers
364 views

Trigger for cloning isn't required for data loading

I have a 'Before Insert' trigger that was developed only because of the 'clone' functionality in SF. In our Managed Package if someone clones our custom object there are a number of fields that we ...
4
votes
5answers
1k views

Clone SObject Relationships

Is it possible to use a database query to get a set of related records and clone them into new related records. sObject[] sObjectsWithChildRelationships = [SELECT Id, (SELECT Id, myObject__c FROM ...
20
votes
6answers
14k views

Copying metadata and code from one Production org to another

How do I copy(for want of a better word) metadata (i.e. Objects, Workflows, Validation rule etc), and code (Apex, Visualforce, Triggers) from one Production org to another production org? Is this ...