• Mike Waugh
  • NEWBIE
  • 0 Points
  • Member since 2012

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

I have a custom field that I have added to the Leads search results that I want to be able to invoke some custom code.  Is there any way that you can use a HYPERLINK tag to target an apex class?  Right now, my custom field contains a formula as follows:

 

I want to be able to manipulate data that is associated to the record in which I have added the custom field upon a user clicking this field within the search results screen before posting the results to an external server.  Is this even possible?

Thanks

Is there a way to read in a static file into a unit test?  

 

I am trying to unit test a large data set coming back in a JSON format from our webservice call and would like to load a sample text file for my unit tests.

 

The overall objective of the unit tests it to test the governor limits on batch inserting a large number of leads.

 

I am trying to make my app call out to our webserver to synchronize some data but I keep getting "<html><body>You are being <a href="http://www.introhive.com/contacts/export.json">redirected</a>.</body></html>" as a response and the request ends.

 

How do I get the http request to follow through to the endpoint?

 

My code is as follows:

 

    Blob toEncode = Blob.valueof( key + ':' + UserInfo.getUserName());

    System.debug( 'Encoded Auth: ' + Encodingutil.base64Encode(toEncode));

        

    Http h = new Http();

    

    HttpRequest req = new HttpRequest();

    req.setEndpoint('https://www.myrestdomain.com/contacts/export.json');

    req.setHeader('Authorization', 'Basic ' + Encodingutil.base64Encode(toEncode));

    req.setMethod('GET');

    

   HttpResponse response = h.send(req);

    

   System.debug( response.getBody() ); => <html><body>You are being <a href="http://www.introhive.com/contacts/export.json">redirected</a>.</body></html>

 

    

 

Is there a way to read in a static file into a unit test?  

 

I am trying to unit test a large data set coming back in a JSON format from our webservice call and would like to load a sample text file for my unit tests.

 

The overall objective of the unit tests it to test the governor limits on batch inserting a large number of leads.