Category: Apex

Relationship Lookup Objects in Triggers are NULL?

February 23rd, 2010, 1 Comment

I see this question once in awhile on the Salesforce.com message boards so I thought I’d put something together. So in this scenario you have a Sales_Order__c custom object which has a lookup relationship to Opportunity. When processing the Sales_Order__c records in your trigger, you want to access some fields on the Opportunity via the [...]

Using List Custom Settings in Salesforce.com

January 7th, 2010, 25 Comments

Salesforce.com recently introduced Custom Settings in Winter ’10 which allows you to store custom data sets and associate them on an org-wide, profile or user basis. Custom Settings are essentially custom objects that are exposed in the applications cache and are accessible via their own API. You can certainly build your own custom objects to [...]

Calling a REST Web Service (JSON) with Apex

January 6th, 2010, 7 Comments

Cross-posted at the Appirio Tech Blog. Using JSON RESTful Web Services with Salesforce.com opens up your org to a number third-party integration opportunities (Google, Yahoo!, Flickr, bespoke, etc.). JSON support isn’t baked into the Force.com platform but Ron Hess at Salesforce.com has created a JSON parser which will do the heavy lifting for you. Last [...]

Automating Salesforce Approval Processes with Apex Triggers

January 4th, 2010, 10 Comments

This question came up on LinkedIn asking how to automatically fire off an approval process when an Opportunity reaches 30% probability. This example was on my to do list so I thought I would knock it out quickly. The trigger fires when an Opportunity is updated and is submitted for approval if the Opportunity’s probability [...]

Problems Parsing JSON Responses with Apex

December 28th, 2009, 6 Comments

A couple of weeks ago I wrote an article and small demo of a REST web service call returning XML. It was my intention to do the same demo using JSON. However, I ran into a small sang; I couldn’t get the Apex JSONObject to work. I worked on the code for most of the [...]

Calling a REST Web Service (XML) with Apex

December 4th, 2009, 4 Comments

This is a cool little example of calling a REST web service with Apex. You enter your address and the Apex code fetches the geo coordinates from Yahoo! Maps. The service returns the data as XML. If you want to run this demo in your own org, you will need to do the following: Add [...]

Force.com Demo with Twilio

November 28th, 2009, No Comments

Cross-posted at the Appirio Tech Blog. During Dreamforce 09 Kyle Roche and I participated in the Developer Hackathon. We hacked-up an application using Force.com and Twilio for inbound and outbound calling. We were only allotted two hours so we were not able to finish off the application during the hackathon. Here is the final demo [...]

Programmatically Creating Sharing Rules with Apex

November 25th, 2009, 5 Comments

Here’s a small Apex Trigger that demonstrates how to programmatically create sharing rules for objects with a private sharing model. It came in handy on a project about a year ago so I thought I’d post it. So the scenario is that the object has a private sharing model (Contacts in this case) so that [...]

Can't Get On The Apex Scheduler Pilot? Here's a Short Term Solution.

November 24th, 2009, 5 Comments

In Winter ’10, Salesforce.com released the Apex Scheduler. This feature allows you to schedule Apex classes to run at specific times. The features appears to be widely popular (200+ votes on the IdeaExchange) but is only in limited release. I’ve heard from a number of companies that they were not able to get on the [...]

Apex “Deep Clone” Controller

November 19th, 2009, 4 Comments

I wrote the following code at the Admin To Hero App Building Workshop and it was very popular. I think we used the code on 3 or 4 projects that day so I thought I’d post it to help everyone out. Essentially it is a Visualforce page and Apex Controller that allows you to do [...]

Feed

http://blog.jeffdouglas.com / Apex

WordPress Appliance - Powered by TurnKey Linux