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

Comments

Popular posts from this blog

Salesforce Fact #913 | Access selected record field values in screen flow lookup w/o Get Records