feed-icon-32x32.png

Subscribe in Feed Reader
Subscribe by Email

Learn how Salesforce.com can help your business
arrowpointe @ twitter
  • if anyone has experience using Crypto.sign() in Apex, it'd be nice to see an example or update my forum post http://is.gd/1lQc0 5 hrs ago
  • random poll: what is the average length of the data in the Description field of your incoming web-to-lead data? how about the max? 2 days ago
  • like @judis217 i'd like @twitter to add a search/sort feature on my follower list. how hard is that? they need a force.com Ideas site. 2 days ago
  • what's so great about Twitters updated follower/following list? nothing really. they never put in features to make the site more functional. 2 days ago
  • destroy twitter is a nice little appl. will try for a while since Twhirl is not in development anymore 5 days ago
  • using wikipedia as my source for unfound/incorrect album art in iTunes 5 days ago
  • is there a way to get a Standard Object's standard fields in the Eclipse object file? the Contracts fields aren't coming thru 1 week ago
  • More updates...

Powered by Twitter Tools.



Retiring 1.x Versions of Auto vCard

Auto vCard 2.0 was released in January of this year with major functionality improvements, one of which was it running native on the force.com platform.  The older 1.x versions of Auto vCard used scripts running on Arrowpointe web servers.

The 1.x scripts are being retired.  If you are running a 1.x version of Auto vCard (go to your Setup | View Installed Packages page in Salesforce to check), you should be aware of the following changes taking place.

  • Beginning  Tuesday, June 16, 2009, the behavior of the 1.x version will be changed.  Instead of the app automatically giving users the option to open/save the vCard, a link will be available on the popup window to get the vCard file.  Also, a new browser window will open directing them to this page explaining that they are on an older version that is set to expire.  Initially, this new behavior will only occur once every 2 days, but it will be more frequent as the July 31 date approaches.
  • Auto vCard 1.x is expiring July 31, 2009.  At that time, anyone on version 1.x will start receiving an error message when creating a vCard.
  • You can avoid issues related to either of the above 2 bullet points by upgrading your Auto vCard installation now.

To learn more about version 2.0, you can visit the product page on our website or the AppExchange listing.  Version 2.0 offers a free 60 day, 5 user trial.  After that, it is $1/user/month to subscribe and you can subscribe any number of your Salesforce users to it.  Non-profits can use it for free.

Comments (0) comments feed

Summer ‘09 Release Schedule

The Summer ‘09 Release is just around the corner.  In fact, NA1 and NA6 are going live tonight.  You can see the schedule at http://status.salesforce.com/trust/status/.  I’ve made a copy of it below.  The first table is in US Pacific time and the second is UTC.

summer09_release_schedule

 

This release is not extremely exciting (unless Sites goes GA), but some of the more exciting features to me are:

Comments (0) comments feed

Force.com Debug Log Parser

Kyle Peterson has released the Force.com Debug Log Parser, a nifty little .NET app for parsing the mess of a debug log you get from Salesforce when executing Apex code.   You can see a video demonstration here.

Great work, Kyle!

P.S. The comments to the post suggest an interest by Salesforce to include this into the IDE.  Hopefully that happens.  Until then, I’ll install this version and use it regularly.

Comments (1) comments feed

Summer 09 Landing Page

Salesforce has published information about their Summer 09 release.  The landing page has all the links you need to get feature details, release notes, etc.  There is lots of really nice stuff coming.

Go to http://www.salesforce.com/community/summer09/ to read up on what’s coming.

Comments (1) comments feed

Testing HTTP Callouts

When writing Apex Code, there are some things that simply cannot be tested, namely HTTP callouts.  The Intro to Apex Code Test Methods has one solution to testing as much of an HTTP callout as possible.  That is to break the HTTP callout into 3 methods: 1) Build Request, 2) Make Request, 3) Handle Response.  In the test method, you are only calling the Build Request and Handle Response methods.

I have another approach.  My main reason for not using the approach mentioned above is that I didn’t read that post until after I developed something.  However, my approach accomplishes the same thing, but also adds a variable to your class so that you can know whether or not a test is running.  Knowing this may be useful in other situations too.

Here’s is a class that uses my technique.

public class sample {

	// Static variable that assumes a test is not running
	public static boolean isApexTest = false;

	public String main(){

	    // Do a whole bunch of stuff

		// Build the http request
		Http h = new Http();
		HttpRequest req = new HttpRequest();
	    req.setEndpoint('http://local.yahooapis.com/MapsService/V1/geocode?appid=YD-9G7bey8_JXxQP6rxl.fBFGgCdNjoDMACQA--&street=701+First+Ave&city=Sunnyvale&state=CA');
	    req.setMethod('GET');

		// Invoke web service call
		String result = '';
		if (!isApexTest){
			// Make a real callout since we are not running a test
			HttpResponse res = h.send(req);
			result = res.getBody();
		} else {
			// A test is running
			result = '<?xml version="1.0"?><ResultSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:yahoo:maps" xsi:schemaLocation="urn:yahoo:maps http://api.local.yahoo.com/MapsService/V1/GeocodeResponse.xsd"><Result precision="address"><Latitude>37.416397</Latitude><Longitude>-122.025055</Longitude><Address>701 1st Ave</Address><City>Sunnyvale</City><State>CA</State><Zip>94089-1019</Zip><Country>US</Country></Result></ResultSet>';
		}

		// Do whole bunch of stuff

	    return result;
	}

	// Wrapper method for "main" that we will call in the Test Class
	public String mainForTest(){
		isApexTest = true;
		return main();
	}
}

I have a static variable called isApexTest that I set to false by default so the code assumes a test is not running.  For testing purposes, I created a “wrapper” method (called “mainForTest()”) that I will call in my test class in order to test the main() method. This wrapper method sets the isApexTest variable to true, calls the main() method and then passes back the result from the main() method. mainForTest() is merely a way to get the isApexTest variable set to true.

My test class is below.

@isTest
private class sample_test {

    static testMethod void main_test() {

		// Establish sample class
		sample s = new sample();

		// Call the mainForTest wrapper method so we can set the variable indicating that a test is running
		String retVal = s.mainForTest();

	 	// Add asserts for validation
	 	String expectedResult = '<?xml version="1.0"?><ResultSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:yahoo:maps" xsi:schemaLocation="urn:yahoo:maps http://api.local.yahoo.com/MapsService/V1/GeocodeResponse.xsd"><Result precision="address"><Latitude>37.416397</Latitude><Longitude>-122.025055</Longitude><Address>701 1st Ave</Address><City>Sunnyvale</City><State>CA</State><Zip>94089-1019</Zip><Country>US</Country></Result></ResultSet>';
	 	System.assertEquals(retVal, expectedResult);

	 }

}

In case you are wondering why I use a static variable for isApexTest instead of a class property, it is because I originally developed this technique to test an Apex Web Service. Since all web service methods are static, I couldn’t create an instance of a class to set the property to true and then call the web service method. Web service methods must be invoked directly and not through an instance of a class. That’s where the wrapper method idea came from.

Another approach than a wrapper method would be to have an input variable to my main() method that accepts true/false whether a test was running.  I did not go with this approach because I might have many methods performing callouts and I preferred to have 1 public variable accessible throughout the entire class than a local variable in each method. If I used a local variable, I would need to keep passing it around to other methods.

Comment with your thoughts and alternative approaches.

Comments (2) comments feed

« Previous entries