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
Adarsh G 6Adarsh G 6 

Login flow for deactivated user

Hi Everyone,
Is is possible to activate a deactivated user in login flow? I have a screen flow which I want to run if the user is deactivated. Is it possible to check if user is deactivaed and activate that user and allow him to login using screen flows?

I have tried activating user record if the user is deactivated and allow him to login. But its not working.

Thanks

AbhishekAbhishek (Salesforce Developers) 
It's not possible to activate an inactive user in Login Flow.

The login flow runs as soon as you log in, but with inactive users, they don't actually make it past the log in screen. If you wanted to automatically activate an inactive user trying to log in, I think you would have to resort to code, if this is possible. The code could potentially check the log-in history and if the error was due to a user being deactivated, it could potentially reactivate them. 


Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

Thanks.