You need to sign in to do that
Don't have an account?

hi all please suggest the solution for this
Need to add Generate new password and notify user immediately check box in Visualforce page? kindly help me out
You need to sign in to do that
Don't have an account?
Use the System.resetPassword(userId, sendUserEmail) function from salesforce. You can also use this one if you want to send a specific template
resetPasswordWithEmailTemplate(userId, sendUserEmail, emailTemplateName)
help document
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_system.htm