THis needs to be in an Action on a button that the user clicks when viewing a specific record (Opportunity Product). Actually I have this on a DataGrid...
<p>string opid = QFDataGrid.DataKeys[QFDataGrid.SelectedIndex].Values["Id"].ToString();
Sage.Entity.Interfaces.IOpportunityProduct opportunityproduct = Sage.Platform.EntityFactory.GetById<Sage.Entity.Interfaces.IOpportunityProduct>(opid);
Sage.Entity.Interfaces.IOpportunityProduct opcopy = Sage.Platform.EntityFactory.Create<Sage.Entity.Interfaces.IOpportunityProduct>();
opcopy.Account = opportunityproduct.Account;
opcopy.Opportunity = opportunityproduct.Opportunity;
opcopy.Broker = opportunityproduct.Broker;
opcopy.Received = opportunityproduct.Received;
opcopy.Save();
The Opportunity Product was copied to a new one. However, that Opportunity Product has several "Opportunity Product Parts" child records that need to be copied as well to the new Opporunity Product. Any isea on how to do this in a Snippet Action Item without direct SQL connection? |