function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
gowtham murugesangowtham murugesan 

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
 
Best Answer chosen by gowtham murugesan
Lokesh KumarLokesh Kumar
You need to write a method in the VF page controller to do this task

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