Read about the new hotness over on the Force.com blog: Salesforce Spring '10 - New User Interface Theme
Tuesday, January 05, 2010
Salesforce Spring '10 - New User Interface Theme
Monday, December 28, 2009
S-Control Deprecation
From the Force.com Blog:
S-Controls were labeled as deprecated in the Spring ‘09 release. With the upcoming Spring ‘10 release, we will be taking the next step in S-Control deprecation. Read the S-Control Deprecation article for more detail on what will and what won't change with the next phase of S-Control deprecation.
Labels: Apex, development, Force.com, Visualforce
Friday, November 27, 2009
Dreamforce 2009: How to Write Good Unit Tests in Force.com Code
In addition to presenting the Creating Rich User Experiences session at Dreamforce 2009, I also presented a session on How to Write Good Unit Tests. I was really happy with how the session turned out - after the session, a couple of attendees told me that they were surprised that I was so enthusiastic about a topic that they had considered to be complete drudgery. They said that they were excited to go back home and start applying the tips that I had provided.
If you haven't already, I encourage you to check out the video, read the accompanying How to Write Good Unit Tests article, download the slide deck and play around with the sample source code from the session.
Labels: Apex, development, events, Force.com, technology evangelism
Wednesday, November 04, 2009
Introduction to Developing Commercial Applications on Force.com
If you're thinking about building a new application on Force.com, be sure to check out the new How to Develop Commerical Applications on Force.com blog post.
Labels: development, Force.com, technology evangelism
Thursday, July 30, 2009
How to Write Good Unit Tests
From the blog:
If you’ve written Apex Code and deployed it to production, then you’ve encountered the 75% code coverage requirement. In order to help you achieve (and hopefully exceed) 75% code coverage, I’ve written an article that introduces some of the most important concepts for crafting good unit tests. It explores the proper structure of unit tests, the code scenarios that your unit tests should cover, and the properties of well-written unit tests.
One property of well-written unit tests is that they are thorough. Good unit tests exercise your code in expected conditions, and in unexpected conditions. One unexpected condition that you may have encountered, is when your code deliberately throws an exception because something out of the ordinary has happened. It’s not necessarily obvious how to write a unit test for this scenario, which is why my article demonstrates this useful pattern:
static testMethod void verifySpecificExceptionIsThrown() {
/* Set up all conditions for testing here. */
try{
/* Call the method being tested here. */
}
catch (SpecificException e){
// If the expected SpecificException is thrown and caught,
// then the test was successful and we can exit.
return;
}
// If the expected SpecificException is not thrown and caught,
// then fail the test.
System.assert(false, 'A SpecificException was expected, but was not thrown.');
}To learn more, and to see this particular pattern in action, read How to Write Good Unit Tests.
Labels: Apex, development, Force.com
Thursday, May 14, 2009
Are You Having Problems Sharing?
From the blog:
Apex Managed Sharing is a really interesting aspect of Force.com. It enables developers to build some very innovative applications.The number one rule in life for author Robert Fulghum is to "Share everything." Your Force.com application is one place where it’s okay to break that rule and not share everything. That’s why Force.com allows developers and administrators to control access to data at many different levels. You can control access at the object-level, the record-level and even at the field-level. In the vast majority of cases, the appropriate Force.com sharing settings can be defined declaratively by simply pointing and clicking. In some cases, developers may need the ability to define even more sophisticated sharing settings, and this is where Apex Managed Sharing comes in.
Apex Managed Sharing allows you to use Apex Code to build sophisticated and dynamic sharing settings that aren’t otherwise possible. For example, a developer can use Apex Managed Sharing to write a trigger that will automatically share a custom object record with a user that has been specified in a lookup field. You can also use Apex Managed Sharing to write custom Visualforce controllers that implement your sharing logic.
After an introduction to sharing, the accompanying article looks at the components of Apex Managed Sharing, and how you can use Apex Managed Sharing in your own applications. The article, Using Apex Managed Sharing to Create Custom Record Sharing Logic, also provides sample code for the trigger described above.
Labels: Apex, development, technology evangelism
Tuesday, April 14, 2009
How to Build an App on Force.com
If you're curious about what it's like to build an app on Force.com, I recommend watching the video from the Force.com in Action - Fast Application Development in the Cloud session that was presented at Cloudforce London. It's an outstanding introduction to many of the services that Force.com provides to business analysts and developers for free.
If you're inspired by the session and want to get your hands dirty, the exercises in the Force.com developer workbook are a great way to get started building apps on Force.com.
The other session videos from Cloudforce London can be found here: http://www.salesforce.com/eu/cloudforce/09-london/recorded-sessions.jsp
Labels: development, events, Force.com, PaaS, technology evangelism
Wednesday, January 14, 2009
Why You Must Put Your Force.com App Under Version Control
Without a version control system, your software development process will not be efficient. And that's the best case scenario - I've seen software development projects fail because version control wasn't used. As a result, I became a version control disciple.
My first experience with CVS was at university during my first major collaborative development project. Throughout the project, my team was very diligent about checking code in to CVS after every significant code change. We regularly ran integration tests and this meant that we always had an accurate understanding of our progress to date. However, it wasn’t until the last day of the project that I really learned the value of version control.
On the due date, my team was feeling calm and confident about our work. We had completed development of all the required features ahead of schedule, and we had already added a number of bonus features. The experience of the team sitting next to us in the computer cluster was a stark contrast to ours.
This other team hadn’t bothered to set up a CVS repository for the project as had been suggested by our instructor. Instead, they had used email to exchange updated code over the course of project. To make matters worse, they had waited until the day before the due date to perform their first full code integration. It was painful to watch them flail against the bugs that they kept discovering. When my team left the computer cluster that evening, it was obvious that the other team wasn't going to be able to submit their project before the midnight deadline. Since then, I’ve used a version control system for every project that’s lasted longer than a day - including projects that I've worked on alone.
I feel a sense of accomplishment every time I check additional functionality in to a project. I also enjoy peace of mind, knowing that I can always revert to an older version of code if my current development direction doesn't work out. It’s so easy to put your entire Force.com application under version control and the benefits are so great, that I can’t think of any valid reasons for not doing so. To prove how simple it is, I recently recorded a video that demonstrates adding a Force.com project to a Subversion repository in less than 90 seconds:
http://blog.sforce.com/sforce/2008/12/put-your-forcecom-app-under-version-control.html
Labels: development, Force.com, technology evangelism
Wednesday, October 29, 2008
(Arguably) The Top 3 Reasons to Attend Dreamforce 2008
As you might be able to tell from some of my previous posts, I'm rather excited about Dreamforce 2008. What I didn't mention are my personal top 3 reasons for attending Dreamforce this year. In chronological order, they are:
Beyond S-Controls: Learn to Use Visualforce in Your Force Platform Apps
If you're familiar with S-Controls and want to know why Visualforce is so much more compelling, then this session is for you! Join Force.com Platform experts as they review the typical uses for S-Controls and explain why Visualforce is easier, faster, and more fun to use in your applications!
Monday November 3
4:45 p.m. - 5:45 p.m.
Presented By
Jesse Lorenz - salesforce.com
Jon Mountjoy - salesforce.com
Build Any UI for Any App Using Visualforce
Learn how to use the latest Force.com Platform innovation, Visualforce, to build any UI for any application. This technical introduction will include code walkthroughs and cover topics including components and common use cases.
Tuesday, November 4
2:00 p.m. - 3:00 p.m.
Presented By
Jotham Fisher-Smith - Surfwriter
Ron Hess - salesforce.com
Jesse Lorenz - salesforce.com
Elevate Your Force.com Platform Apps with the Google Visualization API
Looking to bring the power of the Google Visualization API to your Force.com apps? Attend this session to learn how to add rich charting and visualization capabilities to your Force.com apps in a session jointly presented by Google and Force.com experts.
Wednesday, November 5
11:30 a.m. - 12:30 p.m.
Presented By
Nir Bar-Lev - Google
Jesse Lorenz - salesforce.com
Itai Raz - Google
I hope to see you at Dreamforce and would love to chat after a session, or in the Force.com developer lounge!
Sunday, September 07, 2008
Deploy Force.com Applications to Production Faster
I have a post over on the Force.com blog titled "Deploying Force.com Applications to Production Faster." It was inspired by Steve Andersen's post about how he used the Force.com IDE to reduce his deployment process from 8 hours to 2 hours.
The Force.com Migration Tool is another useful tool for deploying from one salesforce.com environment to another. Both tools leverage the powerful Metadata API.
Labels: development, Force.com
Friday, August 15, 2008
"Apex Code Is Not a Niche Tool"
"[Apex Code] is not a niche tool for a proprietary platform -- rather, it's a Java-like language with an Eclipse-based tool ecosystem and excellent facilities for unleashing immense gains in developer productivity and enterprise project success."
http://blog.sforce.com/sforce/2008/05/proprietary-mis.html
Labels: Apex, development, saas
Thursday, July 10, 2008
Visualforce Helps Developers Build Interesting Applications Faster
I've written before about how programming in Apex allows developers to be much more productive. Visualforce similarly helps developers avoid writing a lot of boring code.
If Visualforce and Apex were a typical development platform, the canonical way of populating a data bound picklist would be something like this:
Visualforce markup:
<apex:pageBlockSectionItem> | ||
<apex:outputLabel value="Category" for="expenseCategory"/> | ||
<apex:selectList multiselect="false" id="expenseCategory" required="true" size="1" value="{!expense.Category__c}"> | ||
<apex:selectOptions value="{!ExpenseCategories}"/> | ||
</apex:selectList> | ||
</apex:pageBlockSectionItem> | ||
With the following controller code:
public List getExpenseCategories() | ||
{ | ||
Map allObjectTypesMap = Schema.getGlobalDescribe(); | ||
Schema.DescribeFieldResult f = Schema.sObjectType.Expense__c.fields.Category__c; | ||
List options = new List(); | ||
options.add(new SelectOption('--None--', '--None--')); | ||
for(Schema.PicklistEntry ple : f.getPicklistValues()) | ||
{ | ||
options.add(new SelectOption(ple.getValue(), ple.getLabel())); | ||
} | ||
| ||
} | ||
One of the benefits of developing on the Force.com platform is that it is very data-driven and has native access to your application's metadata. As a result, the code below is equivalent to the code written above and is much less verbose:
<apex:inputField id="expenseCategory" required="true" value="{!expense.Category__c}"/>As a result, developers can spend their time building really interesting applications and let the Force.com platform worry about the plumbing.
Labels: development, salesforce.com, Visualforce
Wednesday, May 14, 2008
CODA 2go
I've been enjoying the CODA 2go blog. It's been interesting to see some of the process of developing the first large-scale enterprise application on the Force.com platform. It was especially exciting to see CODA 2go launch last week at Dreamforce Europe. Check out their demo here:
http://video.coda.com/CODA2go-sneakPeak.htm
CODA's efforts are clearly pushing the Force.com platform in new directions and I hope that other Force.com developers will also blog about their development experiences as well. I can't wait to test-drive CODA 2go.
Labels: development, saas, salesforce.com
Thursday, March 06, 2008
Speaking of Platforms...
My last post made me realize that I haven't already pointed out Marc Andreessen's excellent essay: The three kinds of platforms you meet on the internet.
And if the essay itself wasn't reward enough, check this out:
Labels: crm, development, saas
Get Your salesforce.com Org Under Version Control
Jeff Atwood, a software engineering hero to many, recently wrote about version control for databases.
His post spurred me to use the Force.com IDE to put my latest salesforce.com project under version control. It's dead simple to utilize a version control system for your entire salesforce application now: S-Controls, Apex code and salesforce schema included. (Here are the instructions for Subversion: Force.com Code Share)
If being able to define a database, build complex logic and create a sophisticated user interface wasn't enough to convince everyone that salesforce.com is a true development platform, the Force.com development environment just made it a little bit harder to deny.
And the whole platform is delivered as a service...
Labels: development, saas
Saturday, February 09, 2008
Favorite HTML/JavaScript Resources
Microsoft's HTML and DHTML Reference. It's saved me hundreds of times - and it's a lot more up to date than my 1998 version of HTML: The Definitive Guide.
DevGuru: JavaScript. Simple and straightforward JavaScript reference.
W3Schools JavaScript Tutorial. Easy to understand examples - that you can experiment with!
Labels: development
Friday, September 28, 2007
Domain Languages: Apex
Tip #17 in The Pragmatic Programmer is:
"Program Close to the Problem Domain."
Lately I've been spending a bunch of time building Apex web services for my customer and I can tell you that it's a super powerful language. My pseudo-code translates almost line-for-line in to Apex code. Here's an example:
//get the oppty line items for this oppty
List opptyLineItems = [Select Id, PricebookEntry.Product2Id from OpportunityLineItem Where OpportunityId = :opptyId]; In C# this one line of code would translate to four or five lines of code. Visualforce is the equivalent development productivity lever for user interfaces. Pretty cool stuff.
Labels: development, saas
Monday, September 17, 2007
Visualforce
Salesforce.com just announced the next step in their evolution towards becoming a complete on demand platform: Visualforce. I can't wait to be able to start building applications with Visualforce instead of lower-level web technologies like ASP.Net and JavaScript, powerful as they may be in their own right.
Labels: development
Saturday, September 01, 2007
Designing Applications
Salesforce.com was originally built as a CRM tool. It's been amazing to see it evolve. I've even begun to see it used to model non-business processes. A co-worker recently used it to manage her wedding's guest list. Everything was stored in our product -Who will be able to attend? Would they prefer Beef, Chicken or Fish? What gift did they give? Has a Thank You card been written yet? The application didn't take very long to build and because of the wonders of SaaS multi-tenancy, my friend got to leverage our reporting module without any extra work!
One thing salesforce.com can't do yet is build custom user interfaces. The building blocks have been exposed, but they're the equivalent of 2x4s, nails, plywood and copper pipe. It still requires traditional software development skills and processes to build a sophisticated custom UI. I've heard that there's a solution coming and I'm excited to hear more about it.
Until then, I'll keep working with JavaScript and ASP.Net 2.0. I just finished up a paper usability study with my current customer for a web-based replacement for their exsiting Excel application. Jakob Nielsen's not surprised, butI'm always amazed by how effective paper prototyping is. I was pretty proud of my hand-sketched design, but after spending an hour with the future user of the system, I discovered a number of workflow flaws. According to Steve McConnell, a requirement that goes undetected during the requirements phase "will cost 10 to 100 times to fix during testing."
It's going to be tough for our ASP.Net 2.0 application to beat Excel for flexibility, but on the upside, our web app is going to perform validation, will use dynamic data sources to populate picklists and will store all user-entered data in a cental location, so our customer will never have to worry about data synchronization issues.
Labels: development