Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Sunday, June 8, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Web Forums - SalesLogix Web Platform & Application Architect
Forum to discuss the use of the SalesLogix Web Platform, Client and Customer Portals, and the Application Architect (For version 7.2 and higher only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Web Platform & Application Architect | New ThreadView:  Search:  
 Author  Thread: Copy a Record
Remy
Posts: 42
 
Copy a RecordYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 May 13 8:00 AM

I created an Action to Copy all values of one record into a New record. But I'm not sure how to go about copying all child records of that record. I could open up a SQL connection and copy them all that way, but is there a better way?


This is 7.5.3

[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: Copy a RecordYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 May 13 7:40 PM

Do it on the LAN? Run some kind of batch job on the LAN? (the new jobservice in 8.0 is perfect for this). I've done this in the past with Knowledge Sync....you basically write a clone record request to a table from the Web....a KS event monitor picks it up and fires off the Basic program script that copies the record(s). if it's hundreds or thousands of items involved in the cloning you don't want to do this through the web....

[Reply][Quote]
Remy
Posts: 42
 
Re: Copy a RecordYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 02 May 13 7:28 AM

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?

[Reply][Quote]
Brian Segers
Posts: 69
 
Re: Copy a RecordYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 02 May 13 9:13 AM

You need to do a for each loop on the child parts


Here is a sample, of course I made up your entitny name so you will have to adjust Smile


 



foreach (Sage.Entity.Interfaces.IOpportunityProductParts pp in opportunityproduct.Parts)


        {


Sage.Entity.Interfaces.IOpportunityProductPart newpp = Sage.Platform.EntityFactory.Create<Sage.Entity.Interfaces.IOpportunityProductPart>();


newpp.OppProduct = pp.OppProduct;


newpp.Name = pp.name;


        }


[Reply][Quote]
Remy
Posts: 42
 
Re: Copy a RecordYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 08 May 13 12:14 PM

Worked like a charm. Thanks Brian!

[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 6/8/2025 3:19:11 AM