Activity › Forums › Salesforce® Discussions › How to convert object to Json string in apex of Salesforce? Salesforce® Discussions How to convert object to Json string in apex of Salesforce? Posted by Aditya on July 24, 2020 at 4:56 PM How to convert object to Json string in apex of Salesforce? Ashish replied 5 years, 10 months ago 3 Members · 2 Replies 2 Replies Kirandeep Member July 24, 2020 at 5:18 PM <pre title=””>Account acc = new Account(Name = ‘Account Name’, Phone = ‘8888888888’, Industry = ‘Agriculture’); //Code to convert Account to JSON string String str = JSON.serialize(acc); [adinserter block='9'] Ashish Member July 25, 2020 at 5:14 AM Hey Aditya, Always check the official Apex developer guide in the first place, so you would get to know all things related to your question. https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_class_System_Json.htm Here, you can check all methods of JSON class. Log In to reply. Public All Members My Connections Only Me PublicAll MembersMy ConnectionsOnly Me Public All Members My Connections Only Me