You need to sign in to do that
Don't have an account?
Instantiate specific sObject from generic code
Hi all,
i'm building an integration on the API using the WSDL from my org.
I'm trying to create a generic class for several (standard and custom) objects, so I can generalize the ETL proces. I'm hoping to make this as resusable as possible.
Struggling to find a solution for the following:
Would it be possible to instatiate an sObject from a string with the object name, via the API?
Something like:
sObject obj = new binding.describeSObjects(string sObjectType[] ); (i know this is not the way to do it...)
Next, would i then be able to use the object's specific fieldnames from the sObject?
Help would be very welcome!
Thanks,
Jochem
You should look at the partner WSDL/API, it makes these generic/metadata driven approaches easier.
Their is a framework already for that named Tolerado. Here is the wiki page that shows, how you can do something like this
http://code.google.com/p/tolerado-sfdc-wsc-apis/wiki/CodeSamplesToleradoSObject