The json tag has no wiki summary.
5
votes
3answers
41 views
Serialize Class to JSON with correct sObject API field names
I want to use the standard Force.com REST API to create a case remotely from another Salesforce instance in my instance.
I want to populate two fields on creation: "Subject" and "txt_UserId__c".
...
1
vote
0answers
27 views
Unable to access Variables outside a ApexRest call
I am trying to parse the response data sent by RestResource in my VF page using Javascript.
The JS looks like:
var forceTKClient = new forcetk.Client();
var Resp;
...
1
vote
1answer
35 views
How to handle REST API JSON response
Is there a good practise,
to get the Ip out of the rest JSON response:
{
"id" : "001D000000IqhSLIAZ",
"errors" : [ ],
"success" : true
}
What I do:
HttpResponse res = h.send(req);
...
-4
votes
2answers
67 views
Parsing Using JSON [closed]
I am integrating Google analytics to salesforce.
I have completed HttpRequest and HttpResponse and got output as a JSON format.
This is my JSON output from rest client addon. Please tell me, how do I ...
2
votes
2answers
69 views
System.JSONException with object-specific recent items
I'm trying to display recent items for custom objects in a visualforce page, however deserializing the object-specific recent items json results in a System.JSONException.
Apex:
public class ...
1
vote
2answers
55 views
Testing Apex Classes created by JSONtoApex
I'm using the json2apex (http://json2apex.herokuapp.com/) function to build a class to I can deserialize the JSON created by this call:
http://services.pbs.org/callsigns/zip/77050.json
It works ...
4
votes
1answer
79 views
Must I really use packages and a developer edition org simply to expose a JSON/REST API?
I have an org with a bunch of custom objects. I need to sync records of these objects with data from an external system. I want to expose a JSON/REST API to the external system and have it send ...
2
votes
3answers
161 views
how to parse the JSON object in salesforce
how to parse the json string . here multiple contact,multiple postalcode and mulitple contactnumber .how can i get the values from this json output.like list of contacts,list of postalcode and list of ...
6
votes
1answer
129 views
Issue JSON parsing illegal(?) characters
I'm getting the following error trying to parse a string with some strange characters:
JSONParser parser = JSON.createParser(jsonResponse);
....
parser.getText();
System.JSONException: ...
2
votes
1answer
124 views
How can I return JSON object from REST service?
I used JSONGenerator to generate a customized JSON String. I know I can return sObject or String using Salesforce REST. But now I am sure I do not want to return sObject because I want the customized ...
2
votes
3answers
91 views
Issue on JSON.serializePretty
I am using Salesforce with a Java integration project.
Here I am integrating data from a SQL database to Salesforce using webservices and vice versa using JSON format webservices.
Here is the code:
...
2
votes
2answers
136 views
How to deal with parsing JSON response when it contains a dynamic object?
While playing with the JSON parser I encountered a use case (described below in detail) for which using JSON.deserialize(JSONResponse, SampleParent.class) method for parsing doesn't work.
Below is ...
5
votes
1answer
208 views
What is the correct JSON to deserialize a map of sObjects?
I'm trying to store a map of sObjects in a static resource. I want to be able to store default values for test setup methods. I was able to get it working with the following JSON in the static ...
6
votes
1answer
147 views
JSON serialize is not handling aggregate results properly in Spring 13
string testSerialize = JSON.serialize(database.query('SELECT COUNT(Id)
custTot, Industry Indus from Account Group by Industry'));
system.debug('test '+ testSerialize);
Ran this query in ...
6
votes
3answers
418 views
JSON.Serialize method not returning null fields
I have been using JSON.Serialize method extensively in one of customer's project. Today salesforce has started rolling out Spring '13 release on sandboxes. My customer's sandbox( cs11) is not listed ...
5
votes
1answer
438 views
JSON.deserialize Array of Objects
I'm trying use the Box 2.0 API which returns everything in JSON. This is great because I can use JSON.deserialize. I've run into one issue when getting the folder and file structure. Box returns it as ...
4
votes
1answer
182 views
JSONGenerator writeString() Internal Error - Can not write text value, expecting field name
I'm using the JSONGenerator writeString() method, and I'm receiving the following internal server error, "Can not write text value, expecting field name"? The debug logs indicate no errors, and ...
1
vote
1answer
181 views
Native JSON parser issue [closed]
It seems that json.serialize method converts null to String 'null'
System.debug(String.isEmpty(null));
Contact con = null;
String jsonCon = JSON.serialize(con);
System.debug(jsonCon);
...
8
votes
2answers
154 views
Use JSON serialization to get around parameter limitations for future methods?
Future methods can only take primitives or collections of primitives as parameters. To get around this you could serialize Sobjects (or classes) to a string and then deserialize them in the future ...
6
votes
2answers
384 views
Why does JSON serialization give different results when the Sobject is created from a SOQL query and when the Sobject is instantiated normally?
I am getting some very odd behavior from the JSON serializer where if the Sobject was originally instantiated from a SOQL query it will exclude any fields that were not part of my query from the ...
5
votes
2answers
373 views
How do you deserialize json properties that are reserved words in apex?
Is there any way to deserialize JSON into an object using JSON.deserialize if some of the property names in the JSON are reserved words in apex? I want to do something like this:
string jsonString = ...
1
vote
2answers
244 views
How do you deserialize json into the correct virtual class?
Let's say I have a virtual class and two classes that extend it and I am getting a JSON response that could be either one of those classes. Is there a way to deserialize the JSON into the appropriate ...
