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
Manish Kumar 61Manish Kumar 61 

Query to read soup data for custom object in Android app

I am looking for some examples for Android app of how can I write a query to retrieve data from a custom object soup that I created. Is it diferent than standard object soup structure

Can anyone give some sample code/ examples?
Best Answer chosen by Manish Kumar 61
Gaurav KheterpalGaurav Kheterpal
The querying process is the same for standard objects and custom objects. For example, if you do this for opportunity
return query("SELECT {Opportunity:Name}, {Opportunity:Id}, {Opportunity:AccountId}, {Opportunity:OwnerId}, {Opportunity:Amount} FROM {Opportunity}");
Similarly for a custom object, you would do something like
return query("SELECT {MyObj:Name}, {MyObj:Id}, {MyObj:Field1}, {MyObj:Field2} FROM {MyObj}");
That should work.

If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others and improve the overall quality of Discussion Forums.

Gaurav Kheterpal
Certified Developer| Salesforce Mobile Evangelist| Developer Forums Moderator| Dreamforce Speaker