Questions tagged [jsongenerator]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
38 views

Removing Extra Bracket From JSON:

I need to remove the extra bracket from the JSON Body which i am sending in a Request: Please find the JSON in below: [ { "securianDocNumbers":["3790772","3790771"], ...
0
votes
1answer
32 views

System.JSONException: Can not write a field name, expecting a value [duplicate]

Im struggling with JSON generator for making a HTTP request public String zendeskCalloutManager(string description, string keyToVerify){ // define a response to caller String outcomeMsg; ...
1
vote
2answers
31 views

rest api dynamic json building, i'm trying to get “parent_codes”: [“63”],below response is giving line breaks

{ "description": "Core", "code": "Core", "Active": true, "category_Type": "campaign_category", "parent_codes": [ "63" ], "parent_Type": "sub_brand" } here i'm ...
0
votes
1answer
38 views

Variable does not exist: Name

string objectname; List<sobject> objList; for(Schema.SObjectType reference : fldResult.getReferenceTo()) { ...
-1
votes
1answer
35 views

Validation on fields results by a SELECT query

I need to make a validation of the results query of many fields. Today this validation is being made one by one, in such effort that, in my opinion, could be less if we used a function and a list or ...
0
votes
1answer
62 views

JSON generation in apex batch - how to correctly configure cc in email sending

Below is my code that my batch calls to create JSON to call and send emails through sendgrid. I am trying to loop through the list of contacts and add them to the CC object's array. i have attempted ...
0
votes
0answers
67 views

null argument for JSONGenerator.writeStringField() in Production. But working fine in Dev Ord/SandBox

I am not getting any idea how to deal with this situation. I am keep getting the same error however I change the code and approach the JSONGenerator.WriteStringField(). It is keep pushing error in ...
0
votes
1answer
27 views

alternative way to traverse through json lists of lists of lists in apex

I have the attached json structure and just wondering is there a better way to traverse through the items to obtain them ? whatever i am doing is working and is shown below , but just would like to ...
0
votes
0answers
73 views

how to deserializeuntype list<object>?

I have below JSON, that we are getting from external system and I am trying to use json.deserializeUntype to associate it to respective maps, objects etc. And then trying to insert into respective ...
0
votes
1answer
152 views

JSON with backslash for CURL. Not able to generate Apex request class

I have a request JSON that other system has given to use. It looks like below: { \"list\": [ { \"m1\": \"tval\", \"fill\": { \"tool\": \"4535\" }, \"respfield\": ...
0
votes
1answer
1k views

Unexpected character ('a' (code 97)): expected a valid value (number, String, array, object, 'true', 'false' or 'null') at input location [1,2]

I have a batch class which makes a call out to an api within the same org (the rest resource was developed by a 3rd party supplier and I cannot see its source code) Anyway, as per the supplier the ...
-3
votes
1answer
136 views

Issue executing references in separate JSON2Apex class

I'm running into obscure issues while executing my Apex code that calls references from a separate JSON2Apex class and I can't figure out where I went wrong. JSON2Apex class: public virtual class ...
1
vote
1answer
220 views

Not sure what to do next with JSON2Apex generated output

I'm not sure what to do next with my JSON2Apex generated output since I only need to see the values for three JSON keys. My generated output is approximately 300 lines long and below is a snippet of ...
0
votes
3answers
210 views

JSON.exceptions when inserting JSON objects inside a larger whole

I'm strongly considering going the JSON.serialize route suggested here, but before I do, I thought I'd throw this up here. (I prefer JSONGenerator, in theory, because I can specify the field names, ...