Salesforce Object vs. DataField
In Salesforce, an Object is a primary data container, from which many datafields may exist. “Account” vs. “Contact” vs. “Opportunity” are data Objects and within which, respectively AccountName, ContactName, OpportunityName exist as datafields. A datafield will have 2 naming conventions: label vs. API Name. A datafield’s label is what is shown to Users in the front-end; you can change datafield labels as-needed without impacting underlying code. Parallel to field label is field API Name. This is the name that all underlying code will leverage, whether through APEX or SOQL queries. Therefore, fields’ API Names should remain unchanged. Once changed, your code may break.
Referencing Object’s FieldNames In writing code, you call up a fieldname by its API Name using the following syntax: ObjectName.FieldAPIname (not Field Label!)
Example 1. Account.AccountName Example 2. Account.AccountAge__c Example 3. TerminatedClient__c.TerminationDate__c
The “__c” denotes the fact that it’s a custom object or field, not provided out-of-the-box as standard Salesforce data components. If an object or a field is custom, meaning you created it, then when you code against it you must reference it by the trailing double underscores and the “c” to denote “custom.”















