+ Start a Discussion
pranav shah 40pranav shah 40 

String To Json Conversion

How can i convert the below string in the  web service class in JSON..

please help..

 global with sharing class NewCustCreation
    //public String Status {get;set;}
    //public List<Account> Data {get;set;}
    //public String Message {get;set;}
    //public String ErrorCode {get; set;}
     public class Account

        public String Name;

    global static String dopost(String Name)
        RestRequest req = RestContext.request;
        RestResponse res = RestContext.response; 
         Account account =  new Account();
         String success = 'Welcome to Salesforce';
         String error = 'Error';
         if(Name!= '')
              return Name;
              return error;   

Hi Pranav Shah 40

string to JSON conversion.

use this JSON class Method:

public static System.JSONParser createParser(String jsonString).

More about details please visit this link:


Please mark as best answer if it helps you.