You need to sign in to do that
Don't have an account?
Brian11
What is JSON.deserializeUntyped() doing?
I recently Used this in my Apex Class and I ran into a weird problem.
From my lightning controller I send the following data as a string format using JSON.Stringify
On my apex Class controller I used JSON.deserializeUntyped() to map it to an object
I wasnt working at all Until I wrapped the data coming from the lightning controller in an object so when I did the following then the JSON.deserializeUntyped() worked perfectly.
Can someone explain why this is necessary. Or is there a solution that better
From my lightning controller I send the following data as a string format using JSON.Stringify
{ item: "4", change: "40", limit: "400" }
On my apex Class controller I used JSON.deserializeUntyped() to map it to an object
Map<String, Object> listJson = (Map<String, Object>) JSON.deserializeUntyped(stringList);
I wasnt working at all Until I wrapped the data coming from the lightning controller in an object so when I did the following then the JSON.deserializeUntyped() worked perfectly.
{ data: { item: "4", change: "40", limit: "400" } }
Can someone explain why this is necessary. Or is there a solution that better
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_class_System_Json.htm#apex_System_Json_deserializeUntyped