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
rupesh ranjanrupesh ranjan 

Hello everyone

Ho to use Sytem.debug in this code..


global with sharing class sendsms {
  @future(callout=true)
    webservice static void sendsms1(String strPhone,String strName){
    AppRemind__c c =[Select Name,Email_Address__c,Phone_Mobile_Number__c, Alert__c from AppRemind__c];
    if(c.Name != null){
       
    if(c.Phone_Mobile_Number__c != null){
        //String txt='Your Appointment No. '+c.Name+'';
        String email=''+c.Email_Address__c+'';
        String phn=''+c.Phone_Mobile_Number__c+'';
            HttpRequest req = new HttpRequest();
            //Setting Endpoint URL to HTTP request
           req.setEndpoint('http://104.236.190.198/API/api.php?request=test_alert&api_key=827ccb0eea8a706c4c34a16891f84e7b&agent_id=11&temp_id=10&type=2&language=en&email_id='+email+'&phone='+phn);
            //set the request type
            req.setMethod('GET');
            //HTTP object creation
            Http http = new Http();
            //Sending the Req throgh HTTPResponse object.
            HTTPResponse res = http.send(req);
            System.debug('---------->'+res);
        }
   
  }
    
    }
    }
Kannan N 10Kannan N 10
Have you attempted to encapsulate the code in try..catch block?
Łukasz BieniawskiŁukasz Bieniawski
Hi Rupesh,
This is not elegant but in most cases works for me. Try to paste at the end of the method i.e. 
Integer r = 9 / 0;

Exception will be thrown but you will be able to review debug log.

Hope this helps,
Lukasz