+ Start a Discussion
zdominguezzdominguez 

Standard Objects API

Hi everyone,

 

Is there an API for the standard objects? I looked through the Salesforce Mobile SDK and I can't seem to find them.

 

(By API I mean Java classes/objects that encapsulate the Salesforce standard objects.)

 

Thanks in advance!

 

 

Cheers,
Zarah. 

SoleesSolees

You need to query does objects to get the info.  In iOS you can add the response to a NSMutableArray and then work it out . And because the name of those objects dont change so you dont have to query all the objects that a user can see, standard and non standard.

zdominguezzdominguez

Hi Solees,

 

Thanks for your answer. I don't fully understand what you are saying, but thanks. I guess the answer to my question is there is no existing API for that.

What I wanted is to be able to pass on the JSON response of a query/HTTP request to a method and have the results parsed automatically into an object. For example, if I send a request to /services/data/v24.0/sobjects/User/<user ID>, I can pass the response to a method like parseUser(String response) and have a User object in return, where I can easily get values using getter methods.

 


Thanks and best regards,

Zarah. 

J2theCJ2theC

The objects are encapsulated on a json representation of a dictionary. You can make your own classes and represent the objects in whichever way fills your needs with the properties you need. The standard salesforce toolkit does not do that work for you.

zdominguezzdominguez

That's what I thought. I was just throwing the idea out there because maybe some already made an open-sourced parser for standard objects. I guess I will roll my own.

Thanks for the reply @J2theC! 

J2theCJ2theC

if you want to create a class base on the JSON response from salesforce, you can use an app called "objectify". Link to objectify . That app will create the code for you and create the class, taking as input a json string. note that this is not runtime/compile time technology, just a separate app to create the classes to add to your project base on the input.

 

you will still need to assign the properties to your new class base on the dictionary.