11 terms

Salesforce Platform Developer I: Logic and Process Automation

STUDY
PLAY

Terms in this set (...)

What is describe information?
Metadata information about sObject and field properties.
What are the two way to describe sobjects?
Tokens
describeSObject schema method
What is a token?
Lightweight, serializable reference to an sObject or a field that is validated at compile time. This is used for token describes
What is a describe result?
Nn object of type Schema.DescribeSObjectResult that contains all the describe properties for the sObject or field. Describe result objects are not serializable, and are validated at runtime.
Verify that the generic sObject is an Account sObject
System.assert(s.getsObjectType() == Account.sObjectType);
Get the sObject describe result for the Account object
Schema.DescribeSObjectResult dsr = Account.sObjectType.getDescribe();
Get the field describe result for the Name field on the Account object
Schema.DescribeFieldResult dfr = Schema.sObjectType.Account.fields.Name;
Verify that the field token is the token for the Name field on an Account object
System.assert(dfr.getSObjectField() == Account.Name);
Get the field describe result from the token
dfr = dfr.getSObjectField().getDescribe();
What are the 2 ways to access the token for an sobject?
Access the sObjectType member variable on an sObject type, such as Account. (Schema.sObjectType t = Account.sObjectType;)
Call the getSObjectType method on an sObject describe result, an sObject variable, a list, or a map. (Account a = new Account(); Schema.sObjectType t = a.getSObjectType();)
What are the 2 ways to access the describe results for an sobject?
Call the getDescribe method on an sObject token. (Schema.DescribeSObjectResult dsr = Account.sObjectType.getDescribe();)
Use the Schema sObjectType static variable with the name of the sObject. (Schema.DescribeSObjectResult dsr = Schema.SObjectType.Account;)