JSON, or JavaScript Object Notation, is an open standard format that uses human-readable text to transmit data objects consisting of attribute–value pairs. It is used primarily to transmit data between a server and web application, as an alternative to XML.

learn more… | top users | synonyms

2
votes
1answer
41 views

Triggers & JSON!

I am trying to run a future method from a trigger. As the future method takes only primitives as parameters, i am serializing the Trigger.new to pass it to a future method. I am deserializing the JSON ...
2
votes
0answers
13 views

Am i doing it rite with this function sforce.interaction.searchAndScreenPop

We are new to sales force integration and we are up to ingrate our company softphone with salesforce. We are using the sforce.interaction.searchAndGetScreenPopUrl for popping up the matched object. As ...
3
votes
1answer
30 views

Display List of Objects in a VF page not working as expected

To put you on perspective, I've created a Detail Page Button that displays in a new window some result data from a callout to a SOAP web service. The thing is, I've tried it in a sanbox, and it works ...
1
vote
0answers
22 views

Google Timeline Rerender problem

I'm trying to include Almende's Google Timelines (Link to documentation) and I'm having some trouble rendering the timeline after the first time. I'm using JSON to fill in the data which is computed ...
0
votes
0answers
10 views

JSONGenerator writeObject() generates private properties

I have an Apex Class with some public properties and some private properties. When I use JSONGenerator.writeObject(foo), private properties are written into the JSON string. My code is below. public ...
2
votes
1answer
41 views

Storing JSON response in SF text field gives '"' instead of double quotes (")

For debug purposes, I'm trying to write the JSON body returned from an HTTP callout into an SF text area field. My problem is, despite the JSON body being stored as a string variable, and despite it ...
0
votes
0answers
14 views

Continuous Webservice call from Developer sandbox to QA sandbox

We wanted to implement a functionality that would fetch data from QA to Developer sandbox for testing purpose. For this: I created a VF page that has only two fields, the first dropdown shows the ...
3
votes
1answer
58 views

System.JSONException: Apex Type unsupported in JSON: Object

I was trying to parse json to apex but i was getting System.JSONException: Apex Type unsupported in JSON: Object My apex code was public class patdetils77 { //public String strBody{ get; ...
1
vote
1answer
32 views

Deserialize JSON to Map - EchoSign REST API response help

I am making a call to the EchoSign REST API and I need to get the signing URL of the most recently signed document using an EchoSign query. I am using the following: HttpRequest req = new ...
2
votes
1answer
72 views

Access sObject list variables in Javascript

Question: I need to create list of sObjects in Javascript. Let's assume accountWrapperList is a list of (Account + checkbox) defined in controller. You can access this list in your javascript if you ...
1
vote
1answer
47 views

POST /validateEmail - How do we utilize this function with only JavaScript/JSON/JQuery?

I have a need for using the POST/validateEmail to do client side ajax validation on an email address prior to submitting data from a webform/webcollect to a data extension. source: ...
1
vote
0answers
33 views

Return success message or error message from AMPscript

I´m constructing a form to get new emails from my website. The form works fine, all fields are recorded at data extension. :) But i have problems to return the success message or error message from ...
5
votes
1answer
88 views

How to build a Apex Class to handle a JSON format in my example

I want to build a custom sync framework and combine serval object's data to a Json string. For example List<Account> accounts = [select Id, Name, ... from Account where ...]; The sOBject is ...
0
votes
1answer
91 views

I am not able to parse string as it needs double quotes format

Please find the code. Apikey= ApexPages.currentPage().getParameters().get('Apikey'); jsonstring='{FirstName:"}'+Apikey; public void parseJsonString(){ JSONParser parser = ...
1
vote
1answer
52 views

Salesforce System Error

I'm getting FATAL_ERROR System.UnexpectedException: Salesforce System Error: 2029807441-269060 (565110838) (565110838) From this code: The line that throws the error has a comment next to it. ...
2
votes
1answer
30 views

How do I access elements from Json?

If I do String json = api.doRetrieve(endpoint); then I get back a json string. This is an array of objects. How do I get it to where I can do obj.someproperty in Java and access it? I'm doing this: ...
1
vote
1answer
49 views

Sample 3rd Party APIs to practice Salesforce Apex callouts

Are there any sample 3rd party APIs that I could make use for practicing Salesforce Apex callouts.
2
votes
1answer
59 views

Triggered Send - passing nested data

Is there any good solution for sending nested (not flat) data to triggered send? Suppose I want to send a transaction confirmation email. Ideally, I would like to send a json (or json-like) object ...
6
votes
2answers
74 views

Is there any logic to how SFDC serializes classes to JSON?

I'm working on documentation for a number of APEX REST API endpoints which returned user-defined types. I'm struggling to write the documentation since the order of how things are serialized into JSON ...
0
votes
1answer
23 views

parsing JSON to class and transforming on-the-fly

I have an @RestResource listening for a JSON string to be passed to me. I then use a JSON2Apex class to parse the JSON into a usable format. However, I receive dates in "seconds", an example of ...
0
votes
2answers
111 views

Deserialize nested JSON

I'm trying to deserialize a nested JSON string and store the values so that I can insert them into a visualforce page. Something like this tutorial here. However, I'm getting the error ...
2
votes
1answer
105 views

Apex JSON.serialize() with null values (RELOADED)

I need to serialize a list of SObject without omission null values. This string I need for a later usage in JavaScript. Structure is crucial, because I need to construct a table out of it. The ...
1
vote
2answers
286 views

System.JSONException: Malformed JSON: Expected '[' at the beginning of List/Set when deserializing JSON object in apex

I'm trying to pass an array of strings from JavaScript to apex. I am initially converting the array into a JSON object and then stringifying the object and passing it into my apex code as a string. So ...
0
votes
0answers
152 views

Kendo Grid with datatype : json in Salesforce

Am developing a web page which uses kendo grid to populate the list of employees. Visual force page : <apex:page controller="Employee_Prav" sidebar="false"> <apex:includeScript ...
2
votes
1answer
67 views

JSON Serialize Anything

Sometimes as quick and drity debugging/introspection I leverage System.assert(false, JSON.serializePretty(<target>)) but it does not always work depending on target, ex: ...
3
votes
1answer
77 views

Setting mm_workspace with spaces in the filepath

I am setting up the Mavensmate Sublime plugin and need assistance setting the mm_workspace. I need this variable set as /Users/Name 1/Google Drive/Salesforce/workspace Here's what I currently have ...
1
vote
3answers
49 views

Converting Date from API response to Salesforce Date

I have a string field in an API response (JSON format) which is meant to be a date. The response field is below: "due":"/Date(1385841600000-0800)/" How can I convert this to an apex date?
1
vote
0answers
28 views

Deal with relationships/associations in JSON response using deserializeUntyped

I am parsing JSON returned from a web request using the deserializeUntyped method. The response contains data from a couple of different models and the relationships are arranged as follows: { ...
2
votes
1answer
90 views

Storing json as a String field is giving wrong value

I have been developing an Apex Trigger where I build a json string from an incomming Event. What I do is serialize the event into the json at first, then deserialize it as a Map and add to it some ...
1
vote
1answer
28 views

Deserialize and reserialize SOobject

i have an object like this: evticket__c et = [Select Id from evticket__c where Id =: id limit 1]; then i serialize it likethis: String obj = JSON.serialize(et); is there a way to create a new ...
1
vote
1answer
224 views

Apex: Get value from first element of Map

I am receiving the following JSON for a web service: { "count" : 1, "posts" : { "1234567" : { "id" : "1234567", "private" : false, "message" : "New post on Monday Jan 5th", ...
1
vote
1answer
138 views

Parse dynamic JSON with Apex

I am receiving the following JSON as a result of a web callout: { "count" : 1, "posts" : { "1234567" : { "id" : "1234567", "private" : false, "message" : ...
0
votes
0answers
104 views

Difference between Apex Heap Size and JSON heap size

Helllo, I am getting a specific error of "JSON string exceeds heap size limit" . I can not find reference specific to JSON related to heap size. I know we have Email Heap size of 36 MB, while ...
0
votes
1answer
158 views

JSON structure to insert multiple Account records in one REST API call

As per the documentation i understood that we can create account in the following way. Example for creating a new Account curl https://na1.salesforce.com/services/data/v20.0/sobjects/Account/ -H ...
2
votes
1answer
288 views

How to deserialize a JSON String to Apex

How can I deserialize this json object: { "response": { "count": 1, "benchmark": 0.22567009925842, "requests": [ { "request": { "id": 537481, ...
-1
votes
2answers
103 views

Write Test class for custom controller having wrapper class that makes a HTTP callout [closed]

Hello All Can anyone please help me to write test class for my custom controller. Below is my custom Controller. public class InsertDataInToNewShopCtrl{ public InsertDataInToNewShopCtrl(){ ...
3
votes
1answer
159 views

scheduled apex to query and create new sObject

I am currently working on creating a scheduled apex to query an external json case objects and insert these objects in salesforce. I am quite new to this framework and quite stuck. The below is a how ...
6
votes
0answers
131 views

deserializing JSON to object: different behavior in unit test vs API?

So let's say I've got a class that looks like this: public class APIParams { public String name; public String category; public Boolean taxable = false; } Then I have a ...
2
votes
1answer
112 views

How can I Deserialze JSON Object and save them to salesforce

I have the following JSON reponse format. I would like to save only specific information on salesforce i.e. all the user details, description, zip code, location, request_status, space and state: { ...
1
vote
1answer
117 views

Trigger to make @future callout to the Data.com match API

My company uses data.com premium. We want to create a trigger that will update a lead based on company information since the out-of-the-box functionality only matches based on the lead. (contact). I ...
0
votes
0answers
21 views

Weird Response from SFDC on calling create Resource URL

I have a JAVA program to use the Create REST Resource. It's working fine and able to create the records. However, I am getting a weird Json reponse from salesforce after record created. ...
0
votes
1answer
454 views

JSON deserialization problem; Invalid conversion from runtime type LIST<ANY> to LIST<type>

I'm running code in Execute Anonymous String responseLite = '[{"candidate_index" : 0, "delivery_line_1" : "address goes here", "input_index" : 0}]'; ...
0
votes
0answers
44 views

Test if String is JSON without actually deseriazing / inserting data

I want to find out if a given String "would" be deserializable without actually doing it. Is there a way to do that ?
0
votes
0answers
14 views

Convert <sf:> tags to another formats

I am new to SF so I don't know much more about it, I am getting a record from SF api for a call details of a number so it returning me data in tags like I am unable to get data from these tags, ...
1
vote
1answer
144 views

Having trouble deserializing a JSON object that contains SF Ids

I am using an geocoding API called Geocodio to process a batch of addresses. I felt I had a good handle on deserializing JSON arrays, but am having trouble deserializing a response that doesn't have ...
1
vote
1answer
276 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 ...
3
votes
1answer
142 views

Give lookup field External Id in JSON request

I am using standard create Rest resource to create an contact record in sales force. In json , I am matching the Label name in request with SFDC custom field name , so SFDC do the mapping for me ...
1
vote
1answer
172 views

deserializing JSON returns a null ojbect

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, ...
1
vote
1answer
70 views

JSON.deserializeUntyped is not working with map set, error : Method does not exist or incorrect signature

I am trying to convert JSON data into a map set, but I tried so hard without any result. Here is my code Map<String, String> m {set; get;} m = (Map <String, String>) ...
1
vote
1answer
579 views

How to convert SObject to JSON in APEX or the reverse

I have a stored data as JSON and I want to convert it to object in order to fill a <apex:pageBlockTable> with it. Is there a library I can use like GSON library ? Or what is the best thing to ...