• arigela
  • NEWBIE
  • 5 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies
Hi,

Can you please help any one to test the below code.
Note:  I am creating test user, and test mock callout in my test class, but getting null pointer exception on when getting sessionId.

 request.setBody('<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"><Header/><Body><login xmlns="urn:partner.soap.sforce.com"><username>' + '<userName>' + '</username><password>' + '<Password>' + '</password></login></Body></Envelope>');
        Dom.XmlNode resultElmt = (new Http()).send(request).getBodyDocument().getRootElement()
        .getChildElement('Body','http://schemas.xmlsoap.org/soap/envelope/')
        .getChildElement('loginResponse','urn:partner.soap.sforce.com')
        .getChildElement('result','urn:partner.soap.sforce.com');
       
        String sessionId = resultElmt.getChildElement('sessionId','urn:partner.soap.sforce.com').getText();

Thanks
Venkat
  • September 10, 2014
  • Like
  • 0
Hi All,

I have plan to get apex percentage used in salesforce through codding. So, for this I am trying to get size without comments from each apex class or currently using characters from apex.

If we able to get directly apex percentage used, then no issues, my problem will solve.

Can you please help me any one on this.

Please find attached image for more details.

Thanks 
VenkatUser-added image
Hi I Want to get "Percent of Apex Used: XX.XX% " and need to send email at perticular level.

Can you please help on this?

Below queries are using for getting but not able to get correct result(These are tooling api objects).

1. SELECT Sum(LengthWithoutComments) FROM ApexClass WHERE ID NOT IN (SELECT ApexTestClassId FROM ApexCodeCoverage)
2. SELECT Sum(LengthWithoutComments) FROM ApexTrigger

I am doing sum of these two result.((Sum(1+2)/10000000)*100)

Thanks
Venkat
Hi All,

I have plan to get apex percentage used in salesforce through codding. So, for this I am trying to get size without comments from each apex class or currently using characters from apex.

If we able to get directly apex percentage used, then no issues, my problem will solve.

Can you please help me any one on this.

Please find attached image for more details.

Thanks 
VenkatUser-added image
Hi I Want to get "Percent of Apex Used: XX.XX% " and need to send email at perticular level.

Can you please help on this?

Below queries are using for getting but not able to get correct result(These are tooling api objects).

1. SELECT Sum(LengthWithoutComments) FROM ApexClass WHERE ID NOT IN (SELECT ApexTestClassId FROM ApexCodeCoverage)
2. SELECT Sum(LengthWithoutComments) FROM ApexTrigger

I am doing sum of these two result.((Sum(1+2)/10000000)*100)

Thanks
Venkat
Hi All,

I have plan to get apex percentage used in salesforce through codding. So, for this I am trying to get size without comments from each apex class or currently using characters from apex.

If we able to get directly apex percentage used, then no issues, my problem will solve.

Can you please help me any one on this.

Please find attached image for more details.

Thanks 
VenkatUser-added image