You need to sign in to do that
Don't have an account?
sfdc13
how to cover below line in test class
when I run the test class I was getting this error::System.JSONException: Unexpected character ('s' (code 115)): expected a valid value (number, String, array, object, 'true', 'false' or 'null') at input location [1,2]
public static String save(string data)
InnerWrapper req =(InnerWrapper)JSON.deserialize(data,InnerWrapper.class);
Inner class
=======
public class InnerWrapper{
List<String> ls;
List<String> types;
String parentId;
Boolean ismpty;
Boolean pSave;
Map<String,Rule__c> type;
String no;
}
public static String save(string data)
InnerWrapper req =(InnerWrapper)JSON.deserialize(data,InnerWrapper.class);
Inner class
=======
public class InnerWrapper{
List<String> ls;
List<String> types;
String parentId;
Boolean ismpty;
Boolean pSave;
Map<String,Rule__c> type;
String no;
}
Here is an example of a class that you can run in the developer console to get you started.
To run in developer console.
Here is a good page on parsing.
https://www.lopau.com/demystifying-json-parsing-in-apex/
All Answers
string data="test data";
can u please give code snippets the type of data i need to pass
Here is an example of a class that you can run in the developer console to get you started.
To run in developer console.
Here is a good page on parsing.
https://www.lopau.com/demystifying-json-parsing-in-apex/