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
NatrajNatraj 

How to add Generate new password and notify user immediately check box (User) in Visualforce page

Hello All,

 

I need to add the  Generate new password and notify user immediately checkbox in visualforce page.

 

How to do this?

 

 

Help me in this...

 

 

Regards,

Natraj

Devendra@SFDCDevendra@SFDC
Try this:
Check if checkbox is checked and the call below method on button click:
user is the instance of User record.
public Pagereference reset()
    {
    Database.DMLOptions dlo = new Database.DMLOptions();
    dlo.EmailHeader.triggerUserEmail = true;
    database.insert(user,dlo);
    return null;
    } 
NatrajNatraj

How should i add the checkbox in visualforce page?.. What is the API name to add the checkbox in Visualforce?

Devendra@SFDCDevendra@SFDC

 

Hi,

 

Why do you need checkbox here? Because there is no such Checkbox field related to User record.

 

Instead  use commandButton to Reset User's password.

 

Thanks,

Devendra