Get Number of Active Users In a Role Using SOQL Query
SQOL Query:
SELECT COUNT(Id) FROM User WHERE UserRole.Name = 'Marketing Manager' AND isActive = true
Note: Change the Role Name as per your requirement.
SQOL Query:
SELECT COUNT(Id) FROM User WHERE UserRole.Name = 'Marketing Manager' AND isActive = true
Note: Change the Role Name as per your requirement.
SQOL Query:
SELECT COUNT(AssigneeId) FROM PermissionSetAssignment WHERE Assignee.isActive = true AND PermissionSet.Name = 'My_Sample_PermissionSet'
Note: Change the Permission Set API Name as per your requirement.
To get the list of Visualforce Page which are defined with the standardController
attribute, we can write SOQL query on ApexPage
object with passing ControllerType
field value Standard
.
Sample SOQL:
SELECT Name, ApiVersion, ControllerKey, ControllerType, Description, NamespacePrefix, MasterLabel, CreatedDate FROM ApexPage Where ControllerType = 'Standard'
We can write SOQL query on ApexPage
object to get all Visualforce Pages from an Org.
Sample SOQL:
SELECT Name, ApiVersion, ControllerKey, ControllerType, Description, NamespacePrefix, MasterLabel, CreatedDate FROM ApexPage
To get specific object apex triggers, we can write SOQL query on ApexTrigger
object with passing the sObject Name in TableEnumOrId
field.
Below SOQL query will return all the triggers written on Account object.
SELECT Name From ApexTrigger Where TableEnumOrId = 'Account'