Posts

Showing posts from August, 2022

Salesforce Fact #500 | Enable toggle based on input text in screen flow

Image
Suppose we have a use case in screen flow where we need to enable a toggle only if the user enters text in the input field. We can implement the same using conditional visibility. Attached are the screenshots.

Salesforce Fact #499 | LightningAlert in screen flow

Image
Using the new LightningAlert feature in LWC, we can show some warning or error alert as well in screen flow. Attached are the screenshots.

Salesforce Fact #498 | Reusing map in apex code

Image
Most of the times in our apex code, we use set collection to store recordIds and then we get the record details and store it in a map. In some of the scenarios, we can make it work using the same map only, no need to use any set. For example, in the Contact trigger we are getting the related AccountIds and getting the account record details later on. We can use a single map to get this done. Attached is the screenshot.

Salesforce Fact #497 | Show prompt in screen flow using LWC

Image
With the Summer'22 release, we have the lightning prompt feature in LWC. Suppose, we have a use case where we need to show a prompt modal in screen flow and accept the user input. Let's use the new LightningPrompt module to implement the same. Also we can navigate to the next screen in the screen flow using FlowNavigationNextEvent module. Attached are the screenshots.

Salesforce Fact #496 | Confirm modal in screen flow using LWC

Image
Now with Summer'22 release, we have lightning alert, confirm and prompt features in LWC. Suppose, we have to show the confirm modal in screen flow. Why not use a LWC with this latest feature. However, the selected choice is not available in the same flow screen. But the selection can be stored for further processing on next screens. Attached are the screenshots.

Salesforce Fact #495 | Rowcount in Count_Distinct()

Image
Do you know while using the Count_Distinct() function, the query row count is equal to the number of rows checked for getting the result. This is not similar to Count() function where the row count is 1. Attached are the screenshots.

Salesforce Fact #494 | Pass selected datatable records from LWC to parent Aura

Image
Let's see how we can pass selected sobject records from LWC  datatable   to parent Aura component. Attached are the screenshots.

Salesforce Fact #493 | Dynamic relatedListId

Image
While using methods from lightning/uiRelatedListApi module, we can pass the relatedListId dynamically. Reference:  https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.reference_wire_adapters_get_related_list_count Attached are the screenshots.

Salesforce Fact #492 | LeadConvertSettings

So how can we deploy standard Lead Conversion field mappings through Copado. There is a metadata type 'LeadConvertSettings' using which we can deploy the field mappings.

Salesforce Fact #491 | Group tasks

Image
Do you know there is an option under Activity Settings to assign the copy of the same task to multiple users i.e. we can select multiple users in the Assigned To field. Steps to enable: Setup -> Activity Settings -> Select the checkbox Enable Group Tasks. This setting is only applicable for Salesforce Classic. In lightning experience, we can select multiple users in the Assigned To field irrespective of this setting. Reference:  help.salesforce.com/s/articleView?id=sf.tasks_enable_group_tasks.htm&type=5   Attached are the screenshots.

Salesforce Fact #490 | @mention partner user

Image
If a Partner or Community user is @mentioned, in addition to having record access, "All with Access" should be selected. Reference:  https://help.salesforce.com/s/articleView?id=000330305&type=1   Attached is the screenshot.

Salesforce Fact #489 | Before triggers in lead conversion

Image
Before triggers on Account, Contact, Opportunity are not executed during Lead Conversion by default. We need to enable option in Lead Settings to get them executed: Setup -> Lead Settings -> Select the checkbox for Require Validation for Converted Leads. Attached is the screenshot.

Salesforce Fact #488 | Who.Name & What.Name in SOQL

Do you know we can get the Name and Related To field's record name field value on task object using relationship query. On Task object, Name field is WhoId i.e. Leads/Contacts and Related To is for other supported objects. So, Who.Name and What.Name works perfectly fine. Example SOQL:  SELECT Id, WhoId, Who.Name, WhatId, What.Name FROM Task

Salesforce Fact #487 | EPT Counter

We can check the page load time in lightning experience using the EPT counter. It can be done on the fly without enabling the debug mode. EPT stands for Experienced Page Time and it is a performance metric used by Salesforce to measure how long does it take for a page to load into a state which a user can meaningfully interact with. To add the page load time, just add the ?eptVisible=1 at the end of the url while inside lightning experience and the page load time counter will be displayed. Reference: https://help.salesforce.com/s/articleView?id=sf.technical_requirements_ept.htm&type=5

Salesforce Fact #486 | Client form factor in LWC

To detect the form factor of the hardware the browser is running on, we can import @salesforce/client/formFactor scoped module in LWC. The possible values are: Large - A desktop client. Medium - A tablet client. Small - A phone client. Reference:  https://developer.salesforce.com/docs/component-library/documentation/lwc/create_client_form_factor.html

Salesforce Fact #485 | Activity settings for multi-day event

Image
Do you know there is an option in Activity Settings which enables to create multi day events. Steps to enable: Setup -> Activity Settings -> Select the checkbox for Enable Multiday Events. If we disable the option, the end date does not appear anymore while creating an event. Reference:  https://help.salesforce.com/s/articleView?id=sf.customizeactivities_eventcaloptions.htm&type=5 Attached are the screenshots.

Salesforce Fact #484 | Actual relationship field available in SOQL

Image
Do you know a cool thing about SOQL. While querying parent record field value, the actual relationship field is implicitly available in SOQL. No need to explicitly add the lookup field in the select fields list. This works fine for both standard and custom object relationships. Attached are the screenshots.

Salesforce Fact #483 | Overloads on @AuraEnabled methods

Image
Starting Summer'22 release, Overloads are not allowed on @AuraEnabled methods anymore. Reference:  https://help.salesforce.com/s/articleView?id=release-notes.rn_apex_ValidationForAuraEnabledAnnotation.htm&type=5&release=238 Attached is the screenshot.

Salesforce Fact #482 | Cyclical server-side forwards detected error

Image
Have you come across this error: 'Cyclical server-side forwards detected'. The error is encountered when the action method in apex:page returns the reference of the current page itself. Attached are the screenshots.