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

0
votes
0answers
25 views

How to implement pagination here?

This is controller where I have queried for listview with out using setFilterId method and I am getting the records according to listview values but pagination is not working public with sharing ...
1
vote
0answers
25 views

Assignment rule always auto fire with no reason

I got a project which needed to setup an public community as an endpoint to receive JSON messages (URL post method). My community home page got a restful apex class to receive message and process it ...
-2
votes
1answer
34 views

How to test Rest Get? [closed]

How to Write a Test Class In salesforce for Get Method using Rest Services if you give the Portal User Id in PostMan it is used to Display the full user Profile Details with associated Contact and ...
0
votes
1answer
38 views

How to parse this Json file in apex controller [closed]

In my controller method I have a JSON file, and I want to parse it. Here is the JSON: [ { "type": "text", "text": "Peut-on conclure un contrat de travail temporaire pour tester le salarié ...
0
votes
1answer
41 views

Parse Json string to Salesforce object? [closed]

How to map json string with salesforce object(consider Lead)??
0
votes
0answers
12 views

How to get oauth2 access and refresh tokens in JSON format

Problem I am trying to connect to an external api using oAuth2, and at the moment have the following code I am running from the Execute Anonymous Window. I keep getting a 401 error and I think the ...
2
votes
2answers
96 views

Processing a json api response using JSONParser class

I am new in using JSONParser class, I am struggling a bit to understand how to use it. The string that I want to use this, is a reponse from an API call, it is a really long string (about 5.4 million ...
1
vote
0answers
55 views

I want Serialize the JSOn in apex class format using map? [closed]

{ "contactId": "003m000000PM2HrAAL", "requestId": 1, "templateAttributes": { "Customer_Name": "siva john" }, "templateId": "1_Month_Pay Stub", ...
1
vote
1answer
69 views

System.JSONException: Malformed JSON: Expected '[' at the beginning of List/Set while deseriliasing json Payload

> I have resolved the issue updating answer for my own question thanks for response Stack-exchange great help everytime : > > > 1.Malformed JSON: Expected '[' > > ...
1
vote
0answers
24 views

I am getting the Error during creating the JSON to APEX?

public class etTemplateNew{ public String contactId; //003m000000PM2HrAAL public Integer requestId = 0; //1 public cls_templateAttributes templateAttributes; public String ...
0
votes
1answer
39 views

Json parse in emails with ampscript

Im trying to parse some weather json data in my email. But I cant quite fiqure out the syntax. With this code I'm trying to get the main.temp value printed. Below is my code so far, but it dosnt work ...
9
votes
1answer
188 views

JSON: Cannot deserialize instance of date from VALUE_STRING

I'm officially breaking up with Salesforce Date parsing. This has got to be the most frustrating thing. I have the following date in a JSON string (full JSON below): 2017-06-03T10:34:24.000Z ...
0
votes
0answers
14 views

MobileConnect: REST API Linebreak

I am attempting to trigger a MobileConnect message via REST API (and PHP) that includes a linebreak (uses \n). However, I haven't been able to successfully get the linebreak to generate. An example of ...
1
vote
0answers
16 views

save data from apex class generated from J.S.O.N response [duplicate]

I have got a JSON response from external system which consists of some data which need to be saved in sales force. Now I have de-serialized the JSON data to apex class using some tool. and how do ...
1
vote
1answer
34 views

Complex Json deserialize using JSON.deserializeUntyped

How to de-serialize following array of response from the url??I have to pass time stamp in the URL as follows:Tried Json to apex too but as it is post method can't use that. String startdate= ...
0
votes
0answers
33 views

How to serialize JSON with apex wrapper class?

public class etTemplatePR { public String toAddress, templateId, contactId; public Integer requestId = 0; //public tAS[] templateAttributes; Map<String, String> jsonStr = new ...
0
votes
0answers
17 views

How to create a JSON serialize key and value with MAP functionality [duplicate]

public class etTemplatePR { public String toAddress, templateId, contactId; public Integer requestId = 0; public tAS[] templateAttributes; public etTemplatePR(String toAddress, String ...
0
votes
1answer
34 views

Wave Analytics Data Flow Change Column names

I'm using a dataflow to bring in Salesforce record data but I would like to rename the columns in my dataset from their Salesforce API name ("SAP_Territory_Name__c") to another name ("Territory"), not ...
1
vote
2answers
39 views

How To Generate JSON Request Body from Wrapper Request Class

I am writing a REST Service and have created Request and Response Wrappers, Finding it difficult to generate the JSON Request Body out of the wrapper classes. Below are the Sample Classes. public ...
0
votes
1answer
36 views

calling PriceBookEntry from Javascript

After reading tons of links, posts and many documents, I decided to ask for help here, hopping some guru can help me with this issue: <!-- Visualforce Remote object component for Products --> ...
1
vote
1answer
43 views

Rest API with JSON using Integration

I have created 3 classes. APex Class Callout Class JSON Parser Class In that "apex class" I'm calling the JSON class. It shows the error"Invalid type: templateAttributes1" Line number 29. Please ...
1
vote
1answer
12 views

Error: report filters

problem, i try to dynamically filter a report but i get an error. The apex code to set the filter dynamically based on some conditions: filtre ='column:\'account.name\',operator:\'equals\', ...
0
votes
0answers
18 views

update object from web application integrated via canvas app

I integrated a canvas app in a visual force page, and this page in an account page layout. I want to update the account record with data sent from the web application, how to get the context in the ...
2
votes
1answer
44 views

JSON.deserialize with arrays with one to many elements

I am consuming a REST service with APEX. Here is a response sample: { "createQuoteOutput": { "response": { "quoteNumber": 945, "temporaryQuoteNumber": "T8652" }, ...
1
vote
1answer
22 views

JSON String test class

I am using a json string like this in a test class. [{ "id":"01t4B000000XrvhQAC", "name":"abc123", "DateRange":{"startDate":"2020-02-17","endDate":"2020-02-26"} }] Now instead of hard ...
2
votes
1answer
44 views

How Can I Ignore Unknown Json Properties in Apex

I'm doing a web service call, and parsing the json response into a wrapper object for display on a Visualforce page. My wrapper object looks like: public class CustomerAddresses { public String ...
2
votes
1answer
47 views

Guide Template Language to provide dynamic links via href attribute from JSON

I'm using GTL to parse a JSON attribute coming from a Data Extension. Everything works fine except links in href attribute. For some reason/limitation they don't render in the href attribute. I was ...
0
votes
1answer
40 views

JSON: how to declare an attribute whose name contains $ symbol? [duplicate]

I have written apex class.variable declaration is: public string QPA$MV2 {get;set;} It shows error: Error: Compile Error: Invalid identifier: QPA$MV2 at line 254 column 23 How to resolve it ? ...
0
votes
1answer
38 views

Getting error while sending/serializing JSON object to update

From Salesforce I am trying to make restful api call to a CPQ system. I am able to make a login (POST request) I am able to query the Account object & retrieve the id & fields on the ...
1
vote
3answers
35 views

JSON Opportunities and OpportunityLineItems garbled

I am trying to POST Opportunity with OpportunityLineItem data to an endpoint. I can get the opportunity data just fine but I am having a lot of trouble with the OpportunityLineItems and I feel myself ...
0
votes
1answer
43 views

unable to deserialize salesforce attachment, exception thrown

Attachment a = [ SELECT Id, Body FROM Attachment WHERE Id='00Pi000000ZdBqv' ]; String jsonStr=JSON.serialize(a); Attachment b = (Attachment) JSON.deserialize(jsonStr,Attachment.class); ...
3
votes
1answer
177 views

Standard REST de-serialisation fails: Unexpected parameter encountered during deserialization

Consider the following class: public class Caps { public Sett SETTINGS {get;set;} } public class Sett { public string foo {get;set;} } When I POST the following JSON: ...
0
votes
1answer
28 views

Retrieve all objects and field attributes in json

I'm totally new to Salesforce, and was asked to provide a json result set with all objects, their associated fields (standard and custom), as well as all field attributes (name, id, type, etc.). My ...
2
votes
1answer
37 views

Serialize JSON attribute that is a reserved keyword in Apex

To use the Javascript tree library DynaTree on my Visualforce page I create JSON data in its controller List<DynaTreeNode> rootNodes = nodesByParentId.get(null).values(); dynaTreeJson = ...
6
votes
1answer
339 views

Why is String.valueOf(Blob) different that Blob.toString()?

I am working on a REST Service that will desiralize the request body and interpret it. My understanding was that calling String.valueOf(objectInstance) would just call objectInstance.toString(). ...
2
votes
2answers
45 views

Creating an Apex Rest Resource for a Request with reserved keywords

I am working on an Apex Rest Resource to provide an integration from our scm provider's web hooks. The request sent by the scm provider is in JSON format so I have created an Apex class to mirror that ...
0
votes
1answer
51 views

How to convert json-formatted records to object records?

Hi I am trying to insert lead records these records in json format. i tried like this: List<string> first = new List<string>(); list<string> last = new List<string>(); ...
1
vote
2answers
69 views

System.JSONException: Unexpected character ('0' (code 48)): was expecting comma to separate OBJECT entries at

This is my apex code public PageReference find() { HttpRequest req = new HttpRequest(); HttpResponse res = new HttpResponse(); Http http = new Http(); String url = ...
1
vote
1answer
81 views

Illegal Value for primitive when trying to parse the json data

I am facing the issue like "Illegal Value for primitive" when trying to parse the json data.Below is the Json Response which i get from a service. [{"revenue": {}, "emails": [{"grade": "A+", "type": ...
0
votes
2answers
89 views

Parse JSON string in AMPscript

We are currently passing a string attribute via the REST API that contains JSON. { "User_List": "[{\"name\":\"john doe\", \"email\":\"john.doe@mail.com\"}, {\"name\":\"jane doe\", ...
-2
votes
1answer
16 views

unstructured data

I have a need to store some data in Salesforce, and be able to access it from other pages and APEX stuff. Basically, the data is JSON. Right now I have APEX code that is attaching it to records as an ...
3
votes
1answer
35 views

PageReference: Redirect to built page

Can I build some XML or JSON in Apex and then redirect to it from a method that returns a PageReference object? public PageReference saveText() { PageReference p = new ...
0
votes
1answer
84 views

System.JSONException: No content to map to Object due to end of input

How to solve this error and why this error is occuring Here is my controller class public List<SelectOption> getItems() { HttpRequest req = new HttpRequest(); ...
0
votes
1answer
44 views

how to obtain the json field name?

The JSON structure I am using is as follows : { "marketingModelPresentation": { "colors": [ … ], "colorThemes": [ … ], "asMap": { … }, "label": { ...
4
votes
1answer
96 views

Deserialize JSON to SObject

Following code is giving me common.apex.runtime.impl.ExecutionException String jsonText = '{"Data": {"attributes": {"type": "Contact"},"Id": "0036100000JUXKkAAP","Description": "","LastName": ...
0
votes
1answer
35 views

how i deserialize Nested Json String into Maps and need to insert it in Salesforce?

{ "ProductionOrder":"O000039", "statusType": "download", "Electronics/": [{ "Fridges": [{ "FileVar": { "Name": "Samsung", ...
1
vote
1answer
46 views

Remote Object Query not respecting multiple criteria on single field

I'm trying to utilize Remote Objects in order to query a Custom Object. Part of my criteria involves getting all records during a particular date range off of a single field. { where: { ...
2
votes
1answer
31 views

RestRequest in RestResource is returning null

I am having a problem reading JSON content using a RestResource. I am always getting a null value. My goal is to create a webhook to receive JSON content. Here is what I did. Created a Visualforce ...
0
votes
1answer
143 views

System.TypeException: Invalid conversion from runtime type Search.ResultSet to Search.Result

i have json string like this downbelow {"0":{"in":"mmm","loc":"1234"},"1":{"in":"mmm","loc":"1234"}} Now i need to parse them as like in | loc --------- mmm| 1234 mmm| 1234 So far i did public ...
3
votes
1answer
57 views

Nesting JSON Generators

I'm writing an Apex REST API to match a public API standard (so I have no choice in names, here) that uses the JSON+HAL format. JSON+HAL APIs have result members that start with "_"(e.g. {"_links": ...