Posts

Showing posts from November, 2021

Salesforce Fact #250 | Quickly know current record type

Many a times we scratch our head just to find out the record type of the current record when the record type field is not available in the page layout. But there is a quick way to know this.  If the quick action contains a Change Record Type button, just click on it and the current record type is the radio button option which is selected.

Salesforce Fact #249 | Dynamic record form in LWC using custom settings

Image
We can create dynamic lightning record form in LWC. We can create a custom setting which will store the Sobject API name and the field API names list(as a comma separated string). Now from the LWC, we can pass the input object name and get the field list from custom settings and render the same in the UI. The field list can be maintained for multiple objects as per the requirement. Attached are the screenshots.

Salesforce Facts #248 | Conditionally show opportunity amount on record page using screen flow

Image
Suppose, we want to show the amount field on Opportunity page layout only when the stage is Closed Lost. Since, Dynamic form is not GA for standard object yet, we need to go with some alternative approach. One option is we can use screen flow and component visibility to achieve this. So first, we need to remove the amount field from the respective page layout. Then we can create a screen flow with a currency field to show the Opportunity amount and also it is open to edit. We are also using an update record element to update the opportunity amount. And this flow would be shown in the record detail page only if the opportunity stage is closed lost. Attached are the screenshots.

Salesforce Fact #247 | Custom case assignment checkbox in screen flow

Image
We can create the custom assignment rule checkbox in screen flow also. Suppose, we are creating Case records from screen flow after accepting input from the users. We can decide to run the assignment rule based on the selection of the checkbox. We can implement this using screen, assignment, apex action and apex code. Attached are the screenshots.

Salesforce Fact #246 | Custom case assignment checkbox in LWC

Image
The case assignment checkbox is not available whenever we are creating any custom lightning UI. However, we can simulate the same using a checkbox and a bit of apex coding. In this example, we have a case assignment rule which sets the owner of the case to Test Queue if the case origin is Phone. Attached are the screenshots.

Salesforce Fact #245 | Enabling Case Assignment checkbox

Image
We all have seen a tiny checkbox appearing while creating or editing Case i.e Assign using active assignment rule checkbox. Let's see how we can enable it on the UI. To enable the checkbox, go to Setup -> Object Manager -> Case -> Case Page Layouts -> Open the respective page layout and click on Layout properties. Now there are two settings for Case Assignment checkbox. One is show on edit page and another is default. 1. If we only select the default, then it will always run the active assignment rules and we won't see the checkbox in the UI. 2. If we select both default and show on edit page, then the checkbox will appear in the UI and it will be selected by default. But we can uncheck if we want. 3. If we select only show on edit page, then the checkbox will appear in the UI and it will be deselected by default. But we can check if we want. 4. If we select none of the checkbox, then the checkbox won't be visible in the UI and none of assignment rule will run. ...

Salesforce Fact #244 | Password retype validation in screen flow

Image
Re-enter password is a common feature while signing up or filling up a form. We can also implement the same in screen flow using password type component and validate input option.  Attached are the screenshots.

General Fact

Image
'this' is apex class holds the class name. It keeps the class name in this format: <ClassName>:[].  Attached are the screenshots.

Salesforce Fact #243 | Show hyperlink using text template in screen flow

Image
Suppose we have a use case where we have to get records in Screen flow and after iterating over the records, show the record names as hyperlink to the record detail page. We can use the text template type resource for this requirement. Attached are the screenshots.