An SObject
represents a specific table in the database that you can discretely query. The API Name is what you reference as ending in __c
. Standard SObjects have names like Account
or Opportunity
, whereas Custom SObjects and Custom Settings have names like MyObject__c
or MySetting__c
. Custom Settings are special objects you can get without a query.
You can store any specific record in a generic SObject
property. If you do so, you lose the ability to get/set most fields by name, but can get them generically.
SObject genericAccount = new Account();
genericAccount.put('Name', 'value');
Account specificAccount = new Account();
specificAccount.Name = 'value';
specificAccount.Name = 'value';