Discussions
- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Security
- Mobile
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- .NET Development
- :
- How to get full sObject base on ID.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
How to get full sObject base on ID.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
11-26-2012 01:27 AM
Hello all,
I'm trying to find a way how I can get the full sObject from SF via API.
- using retrieve() you need to specify the filds which you need to be retrieved bu I will like to get them ALL.
- using search() ... there is no ID fields.
Can someone advice me pls how I can solve this issue?
THX in advance.
Solved! Go to Solution.
Re: How to get full sObject base on ID.
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-07-2012 08:40 AM - edited 12-07-2012 08:43 AM
Here is an example of how you can get all of the fields in an object and create a SOQL query. (Sorry, the example is in Java).
https://gist.github.com/734428
You could create a query and pass the result into a sObject like so:
String SOQL = "select ... from Account where ...";
QueryResult queryResult = sfdcBinding.query(SOQL);
if (queryResult.size > 0)
{
sObject[] Account = queryResult.records;
}
Hope this helps.
Re: How to get full sObject base on ID.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-09-2012 11:38 PM
THX a lot mcintyrej for your reply.
Your solution is interesting but is almost the same result as from retrieve(). You need to specify all fields, as * will not work in select.
Regards Sergiu.
Re: How to get full sObject base on ID.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-10-2012 03:32 AM
Hi,
If you review the link, it explains how to workaround the "*" problem. It is not pretty but should work.
Regards,
John
Re: How to get full sObject base on ID.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-10-2012 03:49 AM
Ops... I didn't look at all at the link ...
THX a lot!!!!... my mistake.

