Posts

Showing posts with the label Reset

Salesforce Fact #957 | Password reset of new user using apex

For new users, we can use the System.setPassword() method to set a password and while logging in they would be prompted to set a new password as per the standard salesforce behavior. However, clicking on cancel would bypass that and would login to the org. This is helpful while creating multiple test users in bulk and to have same password for all instead of manually setting it for each user. Reference:  https://salesforce.stackexchange.com/questions/83345/how-do-i-create-a-user-without-asking-them-to-set-their-password

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 #794 | Reset value in LWC record picker

Image
We can use the clearSelection() method to reset the value in lightning-record-picker. Reference:  https://developer.salesforce.com/docs/component-library/bundle/lightning-record-picker/specification Attached is the screenshot.

Salesforce Fact #743 | Multiple reset passwords from screen flow

Image
We can create a screen flow for admin users to help them reset passwords for multiple users at once. Also, an invocable apex method is needed. Attached are the screenshots. Note: Each call to System.resetPassword() counts as 1 DML statement.

Salesforce Fact #653 | Reset value in combobox

Image
Suppose we have a scenario in LWC where we need to reset the value of the combobox on button click. We can achieve this using template.querySelector(). Attached are the screenshots.

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.