You need to sign in to do that
Don't have an account?
AlSawtooth
Why is JSONParser.getText() null?
I have the following debugs in my code:
I get (in order):
Thank you!
System.debug(parser.nextToken()); System.debug(parser.getCurrentToken()); System.debug(parser.getCurrentName()); System.debug(parser.getText());
I get (in order):
DEBUG| FIELD_NAME DEBUG| FIELD_NAME DEBUG| originalId DEBUG| nullWhy is getText() null? My code uses a while looop to go through a ton of these, and they all have the same pattern - and getText() is null for all of them.
Thank you!
Per the documentation, getText() "Returns the textual representation of the current token or null if there's no current token.No current token exists, and therefore this method returns null, if nextToken has not been called yet for the first time or if the parser has reached the end of the input stream." So in my example, getCurrentToken() returns a value, and nextToken() is being called in the while loop. What am I missing?
(Documentation link: http://www.salesforce.com/us/developer/docs/dbcom_apex230/Content/apex_methods_system_jsonparser.htm)