SOQL Query Cheat Sheet for Salesforce Metadata

Action Link Group Templates
Select Id, IsDeleted, DeveloperName, Language, MasterLabel, NamespacePrefix, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp, ExecutionsAllowed, HoursUntilExpiration, Category, IsPublished FROM ActionLinkGroupTemplate

Apex Class
Select Id, NamespacePrefix, Name, ApiVersion, Status, IsValid, BodyCrc, Body, LengthWithoutComments, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp FROM ApexClass

Apex Trigger
Select Id, Name FROM apextrigger

App
Select Id, Name FROM AppMenuItem

Asset Files
Select Id, IsDeleted, DeveloperName, Language, MasterLabel, NamespacePrefix, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp, ContentDocumentId FROM ContentAsset

Assignment Rules
Select Id, Name, SobjectType, Active, CreatedById, CreatedDate, LastModifiedById, LastModifiedDate, SystemModstamp FROM AssignmentRule

Auth.Provider
SELECT AuthorizeUrl, CustomMetadataTypeRecord, DeveloperName, FriendlyName, Id FROM AuthProvider

Button or Link
Select Id, PageOrSobjectType, Name, IsProtected, Url, EncodingKey, LinkType, OpenType, Height, Width, ShowsLocation, HasScrollbars, HasToolbar, HasMenubar, ShowsStatus, IsResizable, Position, ScontrolId, MasterLabel, Description, DisplayType, RequireRowSelection, NamespacePrefix, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp FROM WebLink

CORSWhitelist origin
Select Id, IsDeleted, DeveloperName, Language, MasterLabel, NamespacePrefix, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp, UrlPattern FROM CorsWhitelistEntry

Call Center
Select Id, Name, InternalName, Version, AdapterUrl, CustomSettings, SystemModstamp, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById FROM CallCenter

Chatter Extension
SELECT CommentCount, CommentReceivedCount, Id, InfluenceRawRank, LikeReceivedCount, ParentId, PostCount, SystemModstamp FROM ChatterActivity

Custom Permission
Select Id, IsDeleted, DeveloperName, Language, MasterLabel, NamespacePrefix, IsProtected, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp, Description FROM CustomPermission

Dashboard
select Id, title from Dashboard

Document
select Id, name from document

Duplicate Rule
Select Id, IsDeleted, SobjectType, DeveloperName, Language, MasterLabel, NamespacePrefix, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp, IsActive, SobjectSubtype FROM DuplicateRule

Email Template
select Id, name from emailtemplate

Event subscription
Select Id, ParentId, SubscriberId, CreatedById, CreatedDate, IsDeleted FROM EntitySubscription

External Data source
Select Id, IsDeleted, DeveloperName, Language, MasterLabel, NamespacePrefix, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp, Type, Endpoint, Repository, IsWritable, PrincipalType, Protocol, AuthProviderId, LargeIconId, SmallIconId, CustomConfiguration FROM ExternalDataSource

Flow Definition
Select Id, DurableId, QualifiedApiName, EntityDefinitionId, NamespacePrefix, DeveloperName, MasterLabel, Label, Length, DataType, ServiceDataTypeId, ValueTypeId, ExtraTypeInfo, IsCalculated, IsHighScaleNumber, IsHtmlFormatted, IsNameField, IsNillable, IsWorkflowFilterable, IsCompactLayoutable, Precision, Scale, IsFieldHistoryTracked, IsIndexed, IsApiFilterable, IsApiSortable, IsListFilterable, IsListSortable, IsApiGroupable, IsListVisible, ControllingFieldDefinitionId, LastModifiedDate, LastModifiedById, PublisherId, RunningUserFieldAccessId, RelationshipName, ReferenceTo, ReferenceTargetField, IsCompound FROM FieldDefinition where DurableId=” 
Folder
Select Name, DeveloperName FROM Folder

Group
Select Id, Name, DeveloperName, RelatedId, Type, Email, OwnerId, DoesSendEmailToMembers, DoesIncludeBosses, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp FROM Group

Letter Head
Select Id, Name, DeveloperName, IsActive, Description, Value, NamespacePrefix, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp FROM BrandTemplate

Lightning component bundle
Select Id, IsDeleted, DeveloperName, Language, MasterLabel, NamespacePrefix, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp, ApiVersion, Description FROM AuraDefinitionBundle

Lightning Page
Select Id, IsDeleted, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp, AuraDefinitionBundleId, DefType, Format, Source FROM AuraDefinition

List View
Select Id, Name, DeveloperName, NamespacePrefix, SobjectType, IsSoqlCompatible, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp, LastViewedDate, LastReferencedDate FROM ListView

Matching Rule
Select Id, IsDeleted, SobjectType, DeveloperName, Language, MasterLabel, NamespacePrefix, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp, MatchEngine, BooleanFilter, Description, RuleStatus, SobjectSubtype FROM MatchingRule

Named Credential
Select Id, IsDeleted, DeveloperName, Language, MasterLabel, NamespacePrefix, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp, Endpoint, PrincipalType, CalloutOptionsGenerateAuthorizationHeader, CalloutOptionsAllowMergeFieldsInHeader, CalloutOptionsAllowMergeFieldsInBody, AuthProviderId FROM NamedCredential
Permission set
select id, name from permissionset

Platform Cache Partition
Select Id, IsDeleted, DeveloperName, Language, MasterLabel, NamespacePrefix, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp, Description, IsDefaultPartition FROM PlatformCachePartition

Queue
select Id from Group where Type = ‘Queue’

Record Type
SELECT id,name  from RecordType

Report
SELECT id, name from report

Role
Select Id, Name, ParentRoleId, RollupDescription, OpportunityAccessForAccountOwner, CaseAccessForAccountOwner, ContactAccessForAccountOwner, ForecastUserId, MayForecastManagerShare, LastModifiedDate, LastModifiedById, SystemModstamp, DeveloperName, PortalAccountId, PortalType, PortalAccountOwnerId FROM UserRole

Security custom Baseline
Select Id, IsDeleted, DeveloperName, Language, MasterLabel, NamespacePrefix, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp, Baseline FROM SecurityCustomBaseline

Site.com
Select Id, Name, Subdomain, UrlPathPrefix, GuestUserId, Status, AdminId, OptionsEnableFeeds, OptionsRequireHttps, OptionsAllowHomePage, OptionsAllowStandardIdeasPages, OptionsAllowStandardSearch, OptionsAllowStandardLookups, OptionsAllowStandardAnswersPages, OptionsAllowGuestSupportApi, OptionsAllowStandardPortalPages, Description, MasterLabel, AnalyticsTrackingCode, SiteType, ClickjackProtectionLevel, DailyBandwidthLimit, DailyBandwidthUsed, DailyRequestTimeLimit, DailyRequestTimeUsed, MonthlyPageViewsEntitlement, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp FROM Site
Static Resource
SELECT body, name from StaticResource

User Provisioning config
Select Id, IsDeleted, DeveloperName, Language, MasterLabel, NamespacePrefix, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp, ConnectedAppId, Notes, Enabled, ApprovalRequired, UserAccountMapping, EnabledOperations, OnUpdateAttributes, LastReconDateTime, NamedCredentialId, ReconFilter FROM UserProvisioningConfig

Visualforce component
Select Id, NamespacePrefix, Name, ApiVersion, MasterLabel, Description, ControllerType, ControllerKey, Markup, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp FROM ApexComponent

Visual force page
Select Id, NamespacePrefix, Name, ApiVersion, MasterLabel, Description, ControllerType, ControllerKey, IsAvailableInTouch, IsConfirmationTokenRequired, Markup, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp FROM ApexPage

Zone
Select Id, SystemModstamp, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, Name, Description, IsActive, IsPublished FROM Community

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s