function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
m 10m 10 

error i am getting below code

i have one object name is Reportconfig(this is my custom object name:Reportconfig) in that below  object field i am mentioned after hting that url json need to save
Report Name
Report Source Url
RID
public class reportcon{
    public String apiKey {set;get;}
    public String jsonResult{Set;get;}
    public void getReport(){
        Map<String,reportconfig__c> myMap=reportconfig.getAll();
        reportconfig__c ws=myMap.get('Report Name');
        String url='https://canvasjs.com/data/gallery/javascript/daily-sales-data.json';
        Http p=new Http();
        HttpRequest request =new HttpRequest();
        request.setEndPoint(url);
        request.setMethod('GET');
        HttpResponse response=p.send(request);
        System.debug('====>>'+response);
        jsonResult=response.getBody();
    }
}
 
Raj VakatiRaj Vakati
What error your getting ? and whihc line ?
Raj VakatiRaj Vakati
Use this class

Map<String,reportconfig__c> myMap=reportconfig__c.getAll();

 
public class reportcon{
    public String apiKey {set;get;}
    public String jsonResult{Set;get;}
    public void getReport(){
        Map<String,reportconfig__c> myMap=reportconfig__c.getAll();
        reportconfig__c ws=myMap.get('Report Name');
        String url='https://canvasjs.com/data/gallery/javascript/daily-sales-data.json';
        Http p=new Http();
        HttpRequest request =new HttpRequest();
        request.setEndPoint(url);
        request.setMethod('GET');
        HttpResponse response=p.send(request);
        System.debug('====>>'+response);
        jsonResult=response.getBody();
    }
}

 
Raj VakatiRaj Vakati
You can do like this
 
String s = 'JSON STRING ';
List<Account> accounts = (List<Account>) JSON.deserialize(s, List<Account>.class);



 
m 10m 10
Hi raj vakati,
I need your help like work support could pin u r details to this email id imranmforce@gmail.com