Questions tagged [deserialize]
The deserialize tag has no usage guidance, but it has a tag wiki.
212
questions
1
vote
1
answer
4k
views
How to deserialize json string to Apex
I have a requirement, where I have to select some value from multipicklist and then send this json response to the server.
There are 2 scenarios:
1st Scenario:
when we are selecting and de-...
2
votes
1
answer
3k
views
deserializing JSON returns a null object
I'm trying to deserialize a JSON response into a list, so that eventually I can iterate through the list and create new contacts from the response.
This is my first time working with APIs and JSON, ...
-2
votes
1
answer
4k
views
why we need to serialize and deserialize
why we need to serialize and deserialize? Why don't we save the value directly into database with out serialize. What is the benefit for doing serialize. I know that by doing serialize it will get ...
4
votes
1
answer
2k
views
JSON.deserializeUntyped returns "unrecognized token: 'NULL'", when JSON token has a null value
We're creating our JSON responses to my salesforce callouts in house, so I'm guessing the issue has to do with how we're representing NULL in the JSON response. Here's a snippet of the response SF ...
1
vote
1
answer
3k
views
JSON.deserialize not ignoring unknown properties.
I'm trying to deserialize a JSON response from an API.
Let's say the JSON looks like this:
{
"pages": 3,
"this_page": 1,
"products": [
{
"id": "1",
"...
1
vote
1
answer
7k
views
JSON Deserialize Byte Array
I'm porting over a rest client from .NET to Apex and in the class that gets initiated by deserializing the JSON response, there is a byte[].
C# Example:
public class MyResponse
{
public ...
1
vote
1
answer
676
views
Access date time in milliseconds from nested soql query
This SOQL statement SELECT name, (SELECT From__c, To__c FROM Trip__r) FROM Account limit 1 will return
Smith [{"From__c":"2013-11-25T15:15:00.000+0000","To__c":"2013-11-27T15:15:00.000+0000"},{"...
9
votes
1
answer
3k
views
APEX ENUM Serialize to and Deserialize from JSON
I have APEX classes defined with enum properties that are to be serialized into JSON. Also, I am reading in JSON and deserializing them back to my defined classes.
To make the enum properties work ...
2
votes
1
answer
767
views
How to do a DML upsert/insert loop in custom object after JSON deserialization?
I'm fairly new to Apex and I am completely at a loss at what to do next. So far I was able to grab and deserialize my JSON I grabbed from a Web Service(This does a GET Method for info for salespeople)....
8
votes
1
answer
32k
views
How to serialize an object as JSON?
I have an object that's pretty extensive (lots of properties and child relationships). I'd like to serialize it. So I am doing the following:
Proposal__c proposal = (Proposal__c) getRecord();
...
4
votes
3
answers
369
views
Deserialising a DateString
I do:
Date d = (Date)JSON.deserialize('2013-06-07T00:00:00.000Z', Date.class);
System.debug('**********d = ' + d);
I expect:
*************d = 2013-06-07 00:00:00
I see:
*************d = 2013-01-...
10
votes
4
answers
34k
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 ...