0

I have following code and I'm trying to deserialize json array to list of sObjects, but I'm getting following exception without any message:

System.JSONException:

String dzejson = '[{"attributes":{"name":"Test"}}]';

List<sObject> objs = (List<sObject>)JSON.deserialize(dzejson, List<sObject>.class);

System.Debug(objs);
  • add the exception message – Safiya PV Apr 27 '17 at 11:49
  • @blackPerlSAF there is no exception printed out saddly – Martin.Kona Apr 27 '17 at 11:50
3

JSON should have following format:

String dzejson = '[{"attributes":{"type":"Contact"}, "lastName":"Test"}]';

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.