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
arti rathodarti rathod 

How to copy fields from one type of SObject record to another type of SObject record as per pre-configured mapping

For example, data from the Account record should be copied to the specified record of contact. 

Admin should have a screen where he should be able to map the fields to be copied from one object to another. Admin can select any object as the source object and target object available from the Salesforce Org.  The mapping will be saved in the backend and used in the code to copy the data.



How to impliment this?





 
ShirishaShirisha (Salesforce Developers) 
Hi Arti,

Greetings!

You can dynamically update the SObjects however,they should be related to each other then only you will be able to copy the data.Also,the fields which you would like to map should be of same data type which is difficult part here.

Also,it is not that easy to query the fields on the Object which the admin has selected since the fields varied for every Object.

Kindly mark it as best answer if it helps so that it can help others in the future.

Warm Regards,
Shirisha Pathuri