Posts

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 #830 | Making field readonly after record creation using field section

Image
Suppose we want to keep a field editable only during the record creation, and once record is created it should be read only in the UI level(for non-admin users). Apart from validation rule, we can make use of field section in lightning app builder to implement the same. In this example, the LeadSource field on opportunity is made read only once it is created by keeping two field instances with two different filters. Note: Field section does not work for community. Attached are the screenshots.

Salesforce Fact #829 | Lead and Contact intelligent views

Intelligence views are available for Leads and Contacts in Sales cloud. It is a one stop place for all the engagement activity and insights of the records. In order to enable it, go to Setup -> Lead Intelligence View Setup / Contact Intelligence View Setup -> Turn the setting on -> Add the Intelligence View Button in the list view button layout. Reference:  https://help.salesforce.com/s/articleView?id=sf.leads_intelligence_view.htm&type=5    https://help.salesforce.com/s/articleView?id=sf.contacts_intelligence_view.htm&type=5

Salesforce Fact #828 | Reset value of LWC record picker using lwc:ref

Image
In LWC, if there are multiple lightning record pickers present and suppose we need to set/reset the value of a particular one, we can make use of the lwc:ref option. Attached are the screenshots.

Salesforce Fact #827 | Adding object in middle in LWC array of objects

Image
In LWC, Many times we deal with the scenario of adding an object conditionally in JS array of objects. And it needs to be added in the middle based on some condition. In this case the spread operator and the ternary operator combo works together. Reference:  https://stackoverflow.com/questions/70385371/js-conditionally-adding-adding-in-the-middle-of-an-array Attached is an example screenshot.

Salesforce Fact #826 | Disable toggle in screen flow

Image
Suppose we have a use case where we have a toggle in the screen flow and we want to allow the user to activate it only once. Once activated it will be disabled. We can use the toggle's value in Disabled attribute in this case. Attached are the screenshots.

Salesforce Fact #825 | Custom property editor in screen flow

The custom property editor is a useful feature in screen flow. It can work as a container of several base components and can pass the data to the screen as set by admin. Flow builder has a JavaScript class for this purpose that uses the inputVariables and validate interfaces. In order to pass the data, the event propagation attributes need to be specified and the custom event name must be 'configuration_editor_input_value_changed'. Reference:  https://developer.salesforce.com/docs/platform/lwc/guide/use-flow-custom-property-editor-lwc-example.html