Posts

Salesforce Fact #950 | Restricted profile cloning in action

We can use the Restricted Profile Cloning setting to avoid exposing permissions in cloned profiles. For example, suppose we have enabled field service in the org and provided CRED access to Work Order object in a profile. Now, for some reason FSL is disabled in the org. Now, profile is cloned and after cloning, the FSL is again enabled in the org. If Restricted profile cloning is enabled, the Work Order object would have no access in the cloned profile. Steps to enable : Setup -> User Management Settings -> enable the toggle for Restricted Profile Cloning. Reference:  https://help.salesforce.com/s/articleView?id=platform.users_restricted_profile_cloning.htm&type=5

Salesforce Fact #949 | If-else statement in lightning email template

Image
We can add if/else condition in Lightning Email template to some extent. In this example, We are showing the Account rating in the template if the parent account is present. Reference:  https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007ifdqr Attached is the screenshot.

Salesforce Fact #948 | Prevent login using Transaction Security Policy

Image
We can use transaction security policy to prevent multiple users from logging into Salesforce. To implement this, we use the LoginEvent, an apex class and custom permission set. In this example, we have created a permission set 'Prevent Login PS' and in the apex class we are checking whether the user is assigned the PS or not. Note: Custom permission check does not work because in that case the context user is Automated user, not the intended user. Reference:  https://salesforce.stackexchange.com/questions/387530/featuremanagement-checkpermission-not-returning-expected-result Attached are the screenshots.

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