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
Anand AgrawalAnand Agrawal 

Facing Problem while creating the Inactive User through Apex code.

Hi,

 

I am trying to create a Inactive User throuth the Visual force & Apex code. The User gets created there is no problem in that, However after creating the Records it redirects the Page to new Page with theMessage: 

 

"Your account has been disabled

Your company administrator has disabled access to the system for you. Please contact your administrator for more information"

 

There is no Failures or Exception in Debug Log, It properly executes the last code of the Function.

 

If I try to Add Active User then it works properly without any redirection of the page. and if I change the state to Inactive of an existing User then also it works fine without any problem.

 

Can u please tell what could be the problem ?

 

Thanks in Advance.

 

Regards,

Anand Agrawal.