Posts

Showing posts with the label lightning

Salesforce Fact #909 | Editable date column in lightning datatable

Image
In lightning datatable, if we have a date format editable column we can use the type as 'date' or 'date-local'. If we use 'date' the editable window shows the time part also, using 'date-local' shows only date part. Reference:  https://developer.salesforce.com/docs/component-library/bundle/lightning-datatable/documentation Attached are the screenshots.

Salesforce Fact #906 | Enable Lightning Login

Lightning Login is a passwordless, faster login approach we have in Salesforce. Let's see how we can enable it for the users. Go to Quick Search -> Session Settings -> Under Lightning Login, check 'Allow Lightning Login' checkbox, if we want to make the feature available based on permission set, we select the checkbox 'Allow only for users with Lightning Login User permission'. Create a PS with the 'Lightning Login User' system permission enabled ->  Assign the PS to the required users -> Login with the user and click on Enroll in Lightning Login option in User details page. And that's it! Note: Lightning login is not supported for external users. Reference:  https://help.salesforce.com/s/articleView?id=xcloud.security_ll_enable.htm&type=5

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 #795 | Readonly lightning record picker

Image
Suppose we want to make the lightning-record-picker readOnly once a value is selected. This is how we can implement this, since it does not support disabled or readOnly attributes. Attached is the screenshot.

Salesforce Fact #646 | Reset draftValues in lightning datatable

Image
In datatable there is a property named 'draftValues' which keeps a track of inline edits made. Now if we have a scenario, where we need revert the inline edits made so far, we can set the draftValues to empty array using bit of logic in JS. Attached are the screenshots.

Salesforce Fact #575 | Form factor

Once a component is in use on a Lightning page, you can only increase the supported form factors for the component, not decrease them. Reference:  https://developer.salesforce.com/docs/component-library/documentation/en/lwc/use_config_form_factors