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

How to convert records one custom object to another object


I have custom Quote object and order custom object and for those two I have child's objects as well.

    |                            |
Quote line Items--Order Items

for this convert, I need some coding references like blogs or pages.
can someone help me how can I do that dynamically?
Thanks In advance!....


Ajay K DubediAjay K Dubedi
Hello Vinod,

There are two ways. Both I had discussed below:-

1. What you can do is use the Data Loader to export all of the field values of the records of one object to another.
  (Data Loader is a client application for the bulk import or export of data. Use it to insert, update, delete, or export    Salesforce records. When importing data, Data Loader reads, extracts, and loads data from comma-separated values (CSV) files or from a database connection.)
2.A custom button and a visualforce page. Visual force page would just have an Action attribute on <apex: page> and a method returning PageReference to the page you want to redirect to and logic to copy/dml on new object. This method will be called from Action on <apex: page>.

You can refer to these link also :-

Hope this helps.

Thank You.
Ajay Dubedi
For anyone else coming down this path, there is a free package on the app exchange that will do exactly this. Give it a go!