Tag Archives: SObject

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

The Secret Life of an SObject: Defaults

Default values, dirty field tracking, checkboxes / booleans, and the Winter’13 loadDefaults argument… When creating custom objects, we can define default values for our fields which are automatically applied when inserting records. Defaulted when? Say we have a custom Sales … Continue reading

Posted in Documentation | Tagged , , , | Leave a comment

Apex Method of the Day – New Map from SObject List

List<SObject> lst; … Map<ID, SObject> mp = new Map<ID, SObject>(lst); Force.com Apex Code Developer’s Guide – Maps from SObject Arrays Original Tweet

Posted in Documentation | Tagged , , | Leave a comment