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

3
votes
3answers
161 views

How can I write a valid JSON format when I want to pass variables in it?

Following is the valid JSON format: String json = '{'+ ' \"A\": \"Value of A\",'+ ' \"B\": \"Value of B\",'+ ' \"C\": \"Value of C\" '+ ...
1
vote
0answers
28 views

Best way to parse “stringified” (sub-)Map<String,String>

In my Auth Provider RegistrationHandler, I received an instance of the Auth.UserData class, filled with users data (in this case it is an external Salesforce user). The usage is very comfortable, as ...
-1
votes
0answers
20 views

testing json parser

I have created a class which helps to automatically update a geolocation field. I have also given the test class but the code coverage is only 72%. below is the code and test class. The lines of code ...
1
vote
1answer
37 views

JSON Unexpected character ('P' (code 80))

I'm working with JSON and I got this error when the page deserializes it: Unexpected character ('P' (code 80)): was expecting comma to separate OBJECT entries at [line:1, column:4074] I write you ...
0
votes
1answer
17 views

Encrypting the JSON request send to external system

Just want to know , if there is way to encrypt the json request that we send to external system. I am integrating with few on-premise external systems and there is ask for encrypted json request from ...
2
votes
0answers
29 views

Remove leading and trailing white space from dynamic JSON in angularjs

I am facing issue while fetching JSON string dynamically using angularjs. Here is one instance where I am facing this issue - If a user enters any value on the UI in a textarea as follows: ...
2
votes
0answers
28 views

My VF page is loading both Mobile & Desktop view

I am using JSON to populate data tables in my page. very Strangly, it's loading the data in both Mobile & Desktop view. Can anyone help me with this? Attaching the screen shot. PFB the code ...
3
votes
3answers
421 views

How can data be extracted from this kind of JSON format?

How can "orderDetails" be extracted from the following JSON payload? { "itemId": "111", "count": "20", "bookOrders": [ { "bookName": "book1", ...
5
votes
2answers
103 views

Deserialize JSON Array With Integer Index

I am trying to avoid having to do a JSON deserialized untyped, but not sure if I can... I get back a response of contact data from a third party that looks something like this: {"data": { ...
4
votes
2answers
41 views

Can you send json from VisualForce to Apex and have it be valid?

I have this JSON object that I've gotten from the front end. I want to send it to Apex and finally send it to my external API. Visualforce: ct_4_sf.RecordingTest.saveVideo( data, ...
2
votes
1answer
49 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
21 views

Am I doing it right with this function sforce.interaction.searchAndScreenPop

We are new to SalesForce integration and we are up to integrate our company softphone with salesforce. We are using the sforce.interaction.searchAndGetScreenPopUrl for popping up the matched object. ...
3
votes
1answer
31 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
27 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
16 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
54 views

Storing JSON response in SF text field gives '&quot;' 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
17 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
80 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
48 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
95 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
56 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
37 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
95 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
97 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
69 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
37 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
59 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
63 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
77 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
24 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
140 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 ...
3
votes
1answer
145 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
350 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
163 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
73 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
84 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
53 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
32 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
99 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
29 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
270 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
157 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
126 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
169 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
398 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
111 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
165 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
144 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
126 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
123 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 ...