-
Recent Posts
Archives
Categories
Tags
- Adapter Pattern
- Administration
- Apex
- Apex Method of the Day
- Approvals
- Batch Apex
- Careers
- Chrome
- Controller
- Customer Portal
- Dreamforce
- Dynamic Binding
- Field Set
- FinancialForce
- FinancialForce.com
- Force.com Site
- Heroku
- Hierarchical Custom Setting
- Identity Provider
- Interface
- ISV
- JSON
- Locking
- Managed Package
- message-driven-architecture
- OAuth
- Orizuru
- Plugin
- Productivity
- Security
- SObject
- SObject Secret Life
- Triggers
- Visualforce
Top Posts & Pages
- Apex Method of the Day - String myString.split(String regExp)
- Apex Method of the Day - String.format(String value, List<String> args)
- IP Address Ranges when Logging in to Salesforce
- Apex Method of the Day - Method (and other) Declarations in Anonymous Blocks
- Apex Method of the Day - String myString.repeat(numTimes)
RSS
Category Archives: Documentation
Batch Apex Query Behaviour
How fresh is your batch? When running a Batch Apex job which implements Database.Batchable<sObject>, you specify a query in the start method (in which you can select up to 50M records) and define an activity to be performed based on these records in … Continue reading
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
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
IP Address Ranges when Logging in to Salesforce
Salesforce user security. Its great. As well as being one of the things customers value highly, its a massive advantage for application developers to be building upon a trusted platform with robust and well considered security features. Restricting logins to specific IP addresses or ranges of addresses … Continue reading
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
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
Apex Method of the Day – String.isEmpty(String myString)
Rather than: Force.com Apex Code Developer’s Guide – String Methods
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
Apex Method of the Day – String myString.split(String regExp)
We can split a String into parts using a token, which in this case is a space: However, the following example, using “.” as a token will fail: System.AssertException: Assertion Failed: Expected: 3, Actual: 0 This is because the token … Continue reading
Apex Method of the Day – String myString.repeat(numTimes)
public class TestUtility { static Integer s_num = 1; public static String getFakeId(Schema.SObjectType sot) { String result = String.valueOf(s_num++); return sot.getDescribe().getKeyPrefix() + ‘0’.repeat(12-result.length()) + result; } } Force.com Apex Code Developer’s Guide – String Methods