Skip to main content

Timeline for Invalid JSON format

Current License: CC BY-SA 3.0

10 events
when toggle format what by license comment
Oct 14, 2017 at 3:09 answer added itsmebasti timeline score: 1
Oct 14, 2017 at 2:55 comment added Ramesh Example objBody=new Example(); objBody.id=‘S001’; objBody.cookie_id=''; objBody.name=‘Ramesh’; objBody.source=‘Mail’; RootObject root=new RootObject(); root.activity=new Activity(); root.activity=objBody; JSONGenerator gen=JSON.createGenerator(true); return gen.getAsString();
Oct 14, 2017 at 2:49 comment added Ramesh Thanks Basti. I don't think we can pass object name in gen.genAsString() method. Also, when we create gen object on JSON then also could not pass object name here. Sorry, I am asking too many thing but I'm very new in Salesforce. ( JSONGenerator gen=JSON.createGenerator(true))
Oct 14, 2017 at 2:30 comment added itsmebasti Please add this code to your question, so we can understand what you are doing. When you are Using the gereator you won't need serialize, you just return it with gen.getAsString(); <- this is already a Json
Oct 14, 2017 at 2:26 comment added Ramesh I'm using below line of code to generate JSON string- JSONGenerator gen=JSON.createGenerator(true); return Json.serialize(root) ; Here, root is the object of class.
Oct 14, 2017 at 2:23 comment added Ramesh I'm using below line of code to generate JSON string- JSONGenerator gen=JSON.createGenerator(true); return Json.serialize(root) ; Here, root is the object of class.
Oct 14, 2017 at 2:22 history edited Adrian Larson CC BY-SA 3.0
deleted 30 characters in body; edited tags
Oct 14, 2017 at 2:16 comment added itsmebasti You are probably serializing an already serialized Json, are you sure obj, isn't already a Json String? Did you output it in apex? what did you see?
Oct 14, 2017 at 2:11 review First posts
Oct 14, 2017 at 4:53
Oct 14, 2017 at 2:09 history asked Ramesh CC BY-SA 3.0