Notifications
Announcements
No record found.
business process is going to be deprecated pretty soon so need an alternative way. We have a need to clone opportunity records in CRM 365.
*This post is locked for comments
Any suggestions will be marked as verified
There's 3rd party tool called Snapshot from Cobalt to clone the record along with its relationships. But it doesn't work for N:N relationships.
is there any solution like workflow javascript??
Hi sandeepc,
please provide more details, like:
1) you need to clone records by plugin / workflow so you are asking for a c# method?
2) you need to clone it by javascript?
3) Something else?
Looking forward for these information.
If you found the answer helpful, please mark as Verified
Join my network on LinkedIn Follow me on Twitter
Thank You & Best Regards
Francesco Picchi
Microsoft Dynamics CRM Consultant, Bologna+Milano, ITALY
Independent Contractor
http://www.francescopicchi.com
Hi,
Here is what you can do.
1. write your own plugin / workflow / console tool.
2. purchase a third party solution.
hi picchi
yes, we were cloning records from workflow in previous 2013 crm. is that possible similarly without 3rd party tool or it is required ?
yes in javascript how it is possible?
Hi sandeepc ,
use the following code inside a custom workflow or plugin.
Please note this example will clone a salesorder with all related salesorderdetail; you need to adapt it to your entity:
Entity orderFROM = crmService.Retrieve("salesorder", new Guid("salesorderguid"), new ColumnSet(true)); Entity orderTO = new Entity("salesorder"); foreach (KeyValuePair<string, object> attr in orderFROM.Attributes) { if (attr.Key == "statecode" || attr.Key == "statuscode" || attr.Key == "salesorderid" || attr.Key == "ordernumber") continue; orderTO[attr.Key] = attr.Value; } Guid orderTOguid = crmService.Create(orderTO); QueryByAttribute query = new QueryByAttribute("salesorderdetail"); query.ColumnSet = new ColumnSet(true); query.Attributes.AddRange("salesorderid"); query.Values.AddRange(orderFROM.Id); List<Entity> orderdetailFROMlist = crmService.RetrieveMultiple(query).Entities.ToList(); List<Entity> salesorderdetailTO = new List<Entity>(); foreach (Entity orderdetailFROM in orderdetailFROMlist) { Entity orderdetailTO = new Entity("salesorderdetail"); foreach (KeyValuePair<string, object> attr in orderdetailFROM.Attributes) { if (attr.Key == "salesorderid") continue; orderdetailTO[attr.Key] = attr.Value; } orderdetailTO["salesorderid"] = orderFROM.Id; crmService.Create(orderdetailTO); }
Please let me know if you solve.
I have few doubts/questions left.
I need to clone Notes/comments in Case
I need to Clone Booking Forecast,Sales Team(Opportunity and related entities) in Opportunity
and i need to do it using C#(Plugins) is that possible if yes how??
Any suggestion pls
yes, you can close anything using the posted code, you only need to adapt code to entity types.
Have you got some doubts? SDK can do everything :-)
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
SA-08121319-0 4
Calum MacFarlane 4
Alex Fun Wei Jie 2