• Parthiban sfdc
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 2
    Replies
Hi all

i need to create a report on changes in two organiztion, so please anyone help me
Hi all,

i got a bad request error for the following class, so please anyone help me to solve this issue


public class WebServiceCallout {

 
    public void Web1() {
   
       String name='sss';
       String username = 'username';
       String password = 'password';
       HttpRequest req = new HttpRequest();
       HttpResponse res = new HttpResponse();
       Http http = new Http();
       Blob headerValue = Blob.valueOf(username+':'+password);
       String authorizationHeader = 'basic ' + EncodingUtil.base64Encode(headerValue);
       req.setHeader('Authorization',authorizationHeader);
       req.setHeader('Content-Type','application/json');
       req.setEndpoint('https://login.salesforce.com/services/apexrest/Account');
       req.setMethod('POST');
       req.setBody('name='+name);
         try {
   
            res = http.send(req);
                system.debug('>>>>>>>>>>>>>>>>'+res.getstatus());
           
        } catch(System.CalloutException e) {
            System.debug('Callout error: '+ e);
            System.debug(res.toString());
        }

    }

   

}
public class contactController {

public List<Contact> getContacts() {
return [SELECT Id,Name, Account.Name, Phone, Email
FROM Contact
ORDER BY LastModifiedDate DESC LIMIT 10];
}
public Contact getContact() {
Id id = System.currentPageReference().getParameters().get('id');
return id == null ? new Contact() :    [SELECT Id, Name
FROM Contact
WHERE Id = :id];
}
}

Hi all,
I wrote a test class for this class but the code coverage is only 10%,I tried so many times but it shows only 10%.can any one provide me test class for the above class.

Thanks
Hi All,
please help me out...bellow scenario

  In my visualforce page i display 10 Records with check box,by using wrapper class and i selecting 5 Records and Click on Printer button,it will print 5 Records details in my printer.
 
  • May 12, 2015
  • Like
  • 0