Posts

Showing posts with the label component

Salesforce Fact #831 | Refresh utility bar lightning component on tab change

Image
While using any lightning component in the utility bar, it does not get refreshed whenever we change the tabs. However, we can make use of aura:locationChange to detect any change in the url and add logic accordingly. Reference:  https://developer.salesforce.com/docs/component-library/bundle/aura:locationChange/documentation In this simple example, we are just printing the current time every time the tab is changed to show that it is a different value each time. Attached are the screenshots.

Salesforce Fact #810 | Call parent component method in child LWC

Image
In order to call parent component's method in child LWC component, we can pass the method as a public property from parent to child and then invoke the same in child component. Reference:  https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000C5ddmSAB Attached are the screenshots.

Salesforce Fact #721 | Default end date based on start date value in screen flow

Image
Another example for reactive screen components. Suppose, we have two date input fields: start date and end date. The end date should be by default, 30 days from start date and can be edited further by the user. We can set the default value using a formula resource and within the same screen. Attached are the screenshots.

Salesforce Fact #717 | Day of week using reactive screen components

Image
Another use case related to reactive screen components. Suppose, we need to see the day of week for an input date value instantly in screen flow. We can use a formula resource to use WEEKDAY() function and use a text input to show the day of the week. Attached are the screenshots.

Salesforce Fact #715 | Dynamic name fields using reactive screen components

Image
Another use case related to reactive screen components. Suppose, we have a screen flow where we are using the Name input type to capture user's name. Now, the name can consist of FirstName, LastName, MiddleName, informalname. Considering FirstName and LastName would always be provided we can dynamically specify the remaining fields to be captured using reactive feature. In this example, we have two checkboxes: one confirming the user has a middle name and one confirming the user has an informal name. Based on the selection made, the fields are formed dynamically and are rendered the same in the UI. Attached are the screenshots.