Using the Salesforce.com OAuth Playground

My article on developer.force.com, Using OAuth to Authorize External Applications, shows how to develop external Java applications that use OAuth to access your Saleforce.com data. But what if you want to do the opposite? What if you need to write an application on the Force.com platform…

Read more

Email a Document with Salesforce.com

After my last post, Create and Email a PDF with Salesforce.com, I received a few comments whether it was possible to do the same with Document stored in Salesforce.com. Could you choose a Document and then send it via email as an attachment? The short answer is yes!…

Read more

Create and Email a PDF with Salesforce.com

This is a continuation of my post a couple of days ago, Attach a PDF to a Record in Salesforce, and shows how to dynamically generate a PDF and attach it to an email. The code is fairly similar and has the same issue with testing the PageReference getContent() method.…

Read more

Attach a PDF to a Record in Salesforce

Salesforce.com makes it extremely easy to generate PDF documents on the fly by simply using the renderAs="pdf" attribute for the <apex:page> component. It's also a snap to attach these PDFs to records as Attachments. Below is a small Visualforce page and Controller that generates a…

Read more

Building a Dynamic Search Page in Visualforce

I brushed this code off and thought it might be useful to someone as a starting point for a dynamic search page. It has some cool functionality including passing search criteria via Javascript to the controller, search as you type, sorting of results by clicking on the column header plus…

Read more

Using RSA-SHA1 with Salesforce Crypto Class

This is a rather obscure post but it will definitely come in handy to someone trying to use the RSA-SHA1 algorithm with the Salesforce Crypto class. I'm spent the past two days trying to hook up OAuth using Apex and various Google Services. The standard HMAC-SHA1 algorithm is fairly straight…

Read more

Testing Salesforce.com Controller Extensions

One thing that salesforce.com is working on is providing developers with a better testing environment. Salesforce.com requires you to write test cases to deploy your code to production but sometimes the process can be painful. Given the lack of something like jUnit you have to implement your own…

Read more

Uploading an Attachment using Visualforce and a Custom Controller

This is a follow up post to Uploading a Document using Visualforce and a Custom Controller showing an example for uploading an attachment for a Contact. The Visualforce page and Controller is very similar with a few exceptions.Attachments are different than documents and are only available for the following…

Read more

Create a New Record in Force.com Sites

So someone asked me yesterday for some code to allow external users to create contact records in Salesforce.com. They needed a simple form where people could enter the details and once submitted receive a confirmation of what information was entered. Here's what the final page that was developed looks…

Read more

Uploading a Document using Visualforce and a Custom Controller

The Salesforce docs for the inputFile Visualforce component has an example of uploading a document using the Standard Controller. Here is a quick example of using a Custom Controller in case you want to make the upload process part of a larger transaction.Make sure you take a look at…

Read more