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);
2
  • add the exception message
    – Safiya PV
    Commented Apr 27, 2017 at 11:49
  • @blackPerlSAF there is no exception printed out saddly Commented Apr 27, 2017 at 11:50

1 Answer 1

3

JSON should have following format:

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .