1

I am getting this exception when parsing JSON that was generated via json.serialize(trigger.new):

System.JSONException: Json Deserialization failed on token 'a0Po000000B12345678' and has left off in the middle of parsing a row. Will go to end of row to begin parsing the next row

Seems to fail on second record:

{
  "a0Po000000B87654321": {
    "attributes": {
      "type": "custom__c",
      "url": "/services/data/v36.0/sobjects/custom__c/a0Po000000B87654321"
    },
    "LastModifiedDate": "2016-05-08T05:16:13.000+0000",
    "Id": "a0Po000000B87654321",
    "Status__c": "Active"
  },
  "a0Po000000B12345678": {
    "attributes": {
      "type": "custom__c",
      "url": "/services/data/v36.0/sobjects/custom__c/a0Po000000B12345678"
    },
    "LastModifiedDate": "2016-05-08T05:16:13.000+0000",
    "Id": "a0Po000000B12345678",
    "Status__c": "Active"
  }

Any ideas why?

  • The JSON you have posted looks valid: can you post the deserialization code (i.e. is it just JSON.deserialize?). How many records are involved i.e. is it possible you are running our of heap space? – Keith C May 9 '16 at 11:47
  • Just a simple JSON.deserialize, around 7 records. – dzh May 10 '16 at 8:54
  • Any reason found for this? I am getting the same error – Sarang Nov 21 '16 at 7:00
  • Sorry, no idea. I think I've ended up doing some alternative design. – dzh Nov 22 '16 at 9:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.