Category: Code Sample

Using AggregateResult in Salesforce.com SOQL

April 12th, 2010, 5 Comments

In Spring ‘10, Salesforce.com released new Apex functionality for aggregate functions in SOQL. These queries return an AggregateResult object which can be somewhat confusing at first. I’ve noticed quite a people searching my blog for this topic so I thought I’d throw some examples together. So the functions count(fieldname), count_distinct(), sum(), avg(), min() and max() [...]

Easily Search and Edit Records with Visualforce

April 7th, 2010, 15 Comments

I tend to over think Visualforce development sometimes and make it harder than it should be. Development with Force.com is surprisingly easy, elegant and quick. For example I recently needed to develop a way for the users to search for records and update specific values. Users should be able to search for records by keyword [...]

Visualforce Row Counter for Iteration Components

April 2nd, 2010, 3 Comments

I have been working on a Visualforce page that displays a list of items from a collection and I want to display the current row number next to each item. I found this post that describes a solution but I think there may be a bug in one of the components so here is proposed [...]

Short Cut the Recordtype Selection Step

March 30th, 2010, 3 Comments

In larger orgs you may have tens or hundreds of recordtypes. For instance, when a user creates a new Opportunity, the first step in the process is to select the correct recordtype from a list of x choices. However, what if, for instance, you have a low-level user that only uses a single recordtype? They [...]

Integrate Chatter & Twitter on Google App Engine using OAuth

March 17th, 2010, No Comments

Cross-posted at the Appirio Tech Blog. At Appirio we’ve been excited about Salesforce Chatter for quite a while. We firmly believe that Chatter has the potential to bridge the gap between enterprise applications and the way people work. We were luckily enough to receive special prerelease access to Chatter to develop our Social PS Enterprise [...]

Writing an Inbound Email Service for Salesforce.com

March 12th, 2010, 19 Comments

Creating an inbound email service for Salesforce.com is a relatively straight forward process but there are a few thing to explain to make your life easier. The email service is an Apex class that implements the Messaging.InboundEmailHandler interface which allows you to process the email contents, headers and attachments. Using the information in the email, [...]

Error Compiling WSC AppEngine Partner Jar for Salesforce.com Sandbox

March 11th, 2010, 3 Comments

I’m working on a demo for Google App Engine that connects to one of our Salesforce.com Sandboxes (hope to be done tomorrow or Monday). The Force.com Web Service Connector (WSC) project has a partner-library.jar that you can download and add to your project to get up and running quickly. However, if you want to connect [...]

Locking sObject Records

March 9th, 2010, 1 Comment

I don’t see this discussed often, but Salesforce.com has the ability to lock sObject records while they are being updated to prevent threading problems and race conditions. To lock records, simply use the FOR UPDATE keywords in your SOQL statements. You do not have to manually commit the records so if your Apex script finishes [...]

Passing Parameters with a CommandButton

March 4th, 2010, 9 Comments

This post is a slight tweak of yesterday’s post, Passing Parameters with a CommandLink. In theory you should just be able to switch out the CommandLink component with a CommandButton component and be golden. However, not so fast. There seem to still be a bug with the CommandButton component. Here is the Visualforce page with [...]

Passing Parameters with a CommandLink

March 3rd, 2010, 5 Comments

Here’s a small example of how you can pass a value to another method via a command link for Salesforce.com. When the link is clicked, the setter fires for the public member nickName. The button click then calls the processLinkClick method where you can do something like process the variable further with DML statement or [...]

Feed

http://blog.jeffdouglas.com / Code Sample

WordPress Appliance - Powered by TurnKey Linux