Posts

Salesforce Fact #947 | Resolving dashboard logged-in user limit error

As we know there's a limit on the number of dashboards with the option to run as the logged-in user, the below queries are useful while troubleshooting and resolving the error: SELECT FolderName,Title FROM Dashboard WHERE Type = 'LoggedInUser' OR Type = 'MyTeamUser' -> This will fetch the list if dynamic dashboards present in the org SELECT Id,Title FROM Dashboard WHERE Type != 'SpecifiedUser' -> This will return dynamic dashboards that are not in private folders.  SELECT Id,Title FROM Dashboard USING SCOPE allPrivate WHERE Type != 'SpecifiedUser'  -> This will return dynamic dashboards that are in private folders. Reference:  https://help.salesforce.com/s/articleView?id=000385369&type=1

Salesforce Fact #946 | Constructing dynamic SOQL using dynamic formula evaluation

Image
With Summer'25 release, Dynamic formula evaluation is possible using  FormulaBuilder.parseAsTemplate() method and merge field syntax. This approach can be used to construct Dynamic SOQL queries. In this example, we are trying to fetch Account records which are matching with a Lead ownerid and Leadsource. Reference:  https://developer.salesforce.com/blogs/2025/05/summer25-developers Attached is the screenshot.

Salesforce Fact #945 | PathAssistant Sobject

There is an Sobject 'PathAssistant' in the Tooling API which we can query to get the list of all paths in the org. Few things to note: 1) If we include the FullName field in the query, we need to make sure the query returns 1 row else we encounter an error. 2) SobjectProcessField denotes the picklist field for which the path has been setup. Reference:  https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_pathassistant.htm

Salesforce Fact #944 | Getting record id in utility bar LWC

If we have an LWC component in the utility bar, we can get record id in the context of a record detail page. For this, we need to check if CurrentPageReference type is standard__recordPage. Reference:  https://developer.salesforce.com/docs/atlas.en-us.api_console.meta/api_console/sforce_api_console_js_lightning_utility_bar_page_context.htm

Salesforce Fact #943 | Get execution context using Quiddity Enum

Sometimes we need to know the context of the execution event of the apex code, whether it is called from UI, anonymous window, data load, batch apex etc. System class provides a Quiddity enum with all the possible values of execution contexts. It can be figured out by calling System.Request.getCurrent().getQuiddity(). For example, If the apex code is invoked from the anonymous window, it returns ANONYMOUS. If the apex code is invoked from any data load using import wizard or Data loader(with Bulk API enabled), it returns BULK_API. Check out the full list of values:  https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_enum_System_Quiddity.htm

Salesforce Fact #942 | PermissionSetLicenseAssign

Similar to PermissionSetAssignment, we have an Sobject PermissionSetLicenseAssign which keeps track of the assigned permission set licenses. The below query returns the list of PSLs assigned to the users: Select Id, PermissionSetLicense.DeveloperName, Assignee.Name FROM PermissionSetLicenseAssign Reference:  https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_permissionsetlicenseassign.htm

Salesforce Fact #941 | Selective Sandbox Access

With the Winter'25 release, we now require to select a public group while creating a Developer or Developer-pro sandbox.  This feature has been termed as 'Selective Sandbox Access'.   This helps to provide access to the new sandbox to a group of users removing the tedious work of removing .invalid from the user's email. Users outside the public group would remain frozen. Reference:  https://help.salesforce.com/s/articleView?id=platform.data_sandbox_selective_access.htm&type=5