function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
TOny MANEROTOny MANERO 

Copy record from a custom object to another custom object

I have a list of records from Object 1, every record has a command link named "Buy" and i want copy the record choosed in Object 2. I've tried to build this with apex code without success. I should create a Master Detail rel but I can't understand how to do that in my specific case. Can you explain  how to copy records from a Object to another with the use of commandLinks?
ShirishaShirisha (Salesforce Developers) 
Hi Tony,

Greetings!

Please check the sample code in the below documentation to copy the record from one object to an another.

https://developer.salesforce.com/forums/?id=9060G0000005RBRQA2

Related reference:https://developer.salesforce.com/forums/?id=906F0000000BH15IAG

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

Warm Regards,
Shirisha Pathuri