Create JSON using apex

JSON Stands for JavaScript Object Notation. Creating JSON in Apex is not a Big Deal. If it's just about serializing an object, the JSON class will be enough by itself. Below is the Query that we can run from Execute Annoynmous block and check the output. System.debug(JSON.serialize( [Select Id from Account limit 1] )); [{"attributes":{"type":"Account","url":"/services/data/v40.0/sobjects/Account/0010O00001kzzCtQAI"},"Id":"0010O00001kzzCtQAI"}] … Continue reading Create JSON using apex