enter image description here

enter image description here

I had a user whose email address has been changed to another user. Now the new user gets an email to change the password along with the security question of the previous user.

How can I prevent the new user to see the security question of the previous user?


If you are a system administrator you can set user password using System.setPassword method

System.setPassword(userId, password as plain text)
  1. Login as system administrator.
  2. Click on Developer console as shown below

enter image description here

  1. Select developer console and execute above code.

enter image description here

When the user logs in with this password, they are not prompted to create a new password and after that he can reset security question.

| improve this answer | |
  • Thanks @Himanshu but I am not in development. Is it possible to do it without coding – kunal gupta Feb 28 '16 at 8:06
  • Are you system administrator? – Himanshu Feb 28 '16 at 8:07
  • @kunalgupta appexchange.salesforce.com/… – kurunve Feb 28 '16 at 9:02
  • @kunalgupta check the updated answer. it is easy enough :) – Himanshu Feb 28 '16 at 9:10
  • @Himanshu: I tried with your above code but got an error message .Would I have to write any class also related to this – kunal gupta Feb 29 '16 at 9:03

To prevent the security question from appearing, you have to reset the password.

It looks like you let a (new) user take the account of another user. That's not a good practice. It's better to disable a user, and create a new account for the new user.

| improve this answer | |
  • actually we had less licenses, so inorder to use the inactive one, I had to put the new user – kunal gupta Feb 28 '16 at 7:57
  • Is there any other option? – kunal gupta Feb 28 '16 at 7:58
  • When you deactivate a user, the licence comes available for the new user – Fred Feb 28 '16 at 7:59
  • 1
    @kunalgupta Don't recycle users if you can help it. It really does make things hard to manage after a while. – sfdcfox Feb 28 '16 at 8:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.