You need to sign in to do that
Don't have an account?
Pranavaditya Kannojoo
Retrieve fields values from list of sObjects dynamically
I have a list of sObjects and also know its field names. We need to retrieve these field values and build a custom object out of it. sObject.getSobject() returns an object and which needs to stored in various fields of the Custom Objects. The data types of fields in custom objects are LongTextArea, ID, Datetime.
Any idea how to do this.
Any idea how to do this.
http://forceguru.blogspot.in/2011/08/inserting-sobject-dynamically-in.html
All Answers
Please go though below example
https://developer.salesforce.com/page/Wrapper_Class
http://forceguru.blogspot.in/2011/08/inserting-sobject-dynamically-in.html
You can use the Describe callls to get the Fields' meta data dynamically and update the records using a upsert or update call in the new SObject.
See the below link for further information on Describe Calls.
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_dynamic_describe_objects_understanding.htm
Regards,
Ashish