Skip to main content
added 1 character in body
Source Link
Adrian Larson
  • 151.4k
  • 38
  • 247
  • 431

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';

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';

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';
Source Link
Adrian Larson
  • 151.4k
  • 38
  • 247
  • 431

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';