Skip to content

Functions

Jason Auger edited this page Nov 29, 2020 · 3 revisions

Public Static Functions

Function Return Type Description
SObjectHelper.getSetOfOrgSObjects(); Set<String> A set of all SObjects in the Salesforce Org. Including setup objects.
SObjectHelper.orgUsesPersonAccounts(); Boolean Returns true if the Salesforce Org uses Person Accounts.

Public Non-Static Functions

Function Expected Params Return Type Description
createQueryStringForRelatedSObject(); String String Creates a query string for lookup fields on the current object. e.g Contact.Account. If the field is a standard Salesforce field it should have 'Id' on the end, and if it is a custom field it should have '__c' on the end.
createQueryStringForRelatedSObjects(); Set<String> or List<String> String Same as above, but for getting for multiple lookups at once. See Quick How To Use for an example.
getDefaultRecordTypeId(); None Id Returns the default record type Id for the User on the current SObject.

Public Variables

Name Type Description
selectAllString String Contains a comma separated string with all available fields on the object. e.g "Id, Name, CreatedDate, CreatedById,..." to achieve the equivalent of SELECT * FROM SObject in Salesforce.
mapRecordTypeNameToId Map<String, Id> The Key (String) is the DeveloperName of the record type. The Value (Id) is the Salesforce Id value for that record type.
mapDevNameToType Map<String, String> The Key (String) is the DeveloperName of a field on the SObject. The Value (String) is the data type of the field.
mapPicklistValues Map<String, List<Schema.PicklistEntry>> The Key (String) is the name of a picklist field on the SObject. The Value (List) is a list of PicklistEntry records for the picklist. Which can be used to populate a picklist with available options. More information: Salesforce: Schema.PicklistEntry
mapRelatedSObjectFields Map<String, Set<String>> The Key (String) is the name of the SObject. The Values are the field names for all fields on that SObject.
Clone this wiki locally