Tag Archives: Apex

FlexQueue and the Evolution of Asynchronous Apex

Governor Grappling Sooner or later (okay, sooner rather than later) when working in Apex we will need to grapple with Apex Governor Limits Because Apex runs in a multitenant environment, the Apex runtime engine strictly enforces limits to ensure that runaway … Continue reading

Posted in Documentation | Tagged , , | Leave a comment

Apex Method of the Day – JSON.serialize(Object)

Sometimes using JSON.serialize on a custom Apex type does not provide sufficient control over how the JSON is serialized. For example, serializing an Apex type will include null values for all fields that haven’t been set, when you might prefer … Continue reading

Posted in Documentation | Tagged , | Leave a comment

One controller to rule them all…

I recently wanted to create an extension controller for a custom object which I could use with both single records and a set of records. In other words, a list and detail controller extension, with actions that could be applied to one or many records. I … Continue reading

Posted in Patterns | Tagged , , , | 1 Comment

Apex Method of the Day – String.format(String value, List<String> args)

The above is an example of simple token replacement and is equivalent to: Why bother? Well, for more complex strings use of String.format can be easier to write and maintain than concatenation, but a great benefit comes from its combination … Continue reading

Posted in Documentation | Tagged , | Leave a comment

Constructive Forces at Work

A constructor in Apex is called when an instance of a class is created. Code-wise constructors might look like member methods, but they differ in a couple of significant ways. First, constructors can’t be called any other time than when … Continue reading

Posted in Documentation | Tagged | Leave a comment

Apex Method of the Day – String.isEmpty(String myString)

Rather than: Force.com Apex Code Developer’s Guide – String Methods

Posted in Documentation | Tagged , | 1 Comment

The Secret Life of an SObject: Equality, Sets and Maps

Equality When testing for equality between sObjects in Apex, it is the sObjects’ properties – the values of the sObjects’ fields – which are compared. So two separate sObject instances that have the same field values are considered equal: But, if … Continue reading

Posted in Documentation | Tagged , , | 6 Comments