You need to sign in to do that
Don't have an account?
debprakash shaw
I get null value when deserialize then Json object
Hi,
I get a null value when deserialize the JSON
This field value I deserialize.
I get a null value when deserialize the JSON
This field value I deserialize.
public class OrderUpdateJSON { public ContactJson ContactJson; public class ContactJson{ public String referrer_id; public String contact_email; } public static OrderUpdateJSON parse(String json) { return (OrderUpdateJSON) System.JSON.deserialize(json, OrderUpdateJSON.class); } }This is my class where I call a Deserialize class for Json2Apex convert
public with sharing class DeletionScript { public static void ContactJson(List<Handle_JSON__c> contJson){ for(Handle_JSON__c hj:contJson){ string bdy=hj.JSON__c; OrderUpdateJSON objMainJason=(OrderUpdateJSON) System.JSON.deserialize(bdy,OrderUpdateJSON.class); system.debug('objMainJason------->' + objMainJason); //I get here null value OrderUpdateJSON.ContactJson objAH=objMainJason.ContactJson; system.debug('objAH==>'+objAH);//i get null value here string referrer=objAH.referrer_id; string email=objAH.contact_email; } } }
I get null value debug is
Please give me a suggestion to resolve this issue
Thanks in Advanced