By Clicking the new user from UI it's not possible.
It's default checked as True by Salesforce.It's Standard field so it's not possible to edit property of that field
But you can use the Apex to insert the record as Inactive user i tried now it works . Try to execute the below code using devconsole or workbench. Also try yourself with Process builder because i didn't tried to create the user by PB.
List<User> userList = new List<User>(); List<Profile> profileList = [Select Id from Profile where Name=: 'System Administrator' limit 1]; List<UserRole> roleList = [Select Id from UserRole where Name=: 'CEO' limit 1]; User uObj = new User(); uObj.LastName = 'MahaRaj'; uObj.Username = 'maharajancm@gmail.com'; uObj.Email = 'maharajansfdc@gmail.com'; uObj.Alias = 'mc'; uObj.UserRoleId = roleList[0].Id; uObj.ProfileId = profileList[0].Id; uObj.IsActive = true; uObj.TimeZoneSidKey = 'GMT'; uObj.LanguageLocaleKey = 'en_US'; uObj.EmailEncodingKey = 'UTF-8'; uObj.LocaleSidKey = 'en_US'; uObj.IsActive = False ; userList.add(uObj);
insert userList;
Can you please Let me know if it helps or not!!!
If it helps don't forget to mark this as a best answer!!!
By Clicking the new user from UI it's not possible.
It's default checked as True by Salesforce.It's Standard field so it's not possible to edit property of that field
But you can use the Apex to insert the record as Inactive user i tried now it works . Try to execute the below code using devconsole or workbench. Also try yourself with Process builder because i didn't tried to create the user by PB.
List<User> userList = new List<User>(); List<Profile> profileList = [Select Id from Profile where Name=: 'System Administrator' limit 1]; List<UserRole> roleList = [Select Id from UserRole where Name=: 'CEO' limit 1]; User uObj = new User(); uObj.LastName = 'MahaRaj'; uObj.Username = 'maharajancm@gmail.com'; uObj.Email = 'maharajansfdc@gmail.com'; uObj.Alias = 'mc'; uObj.UserRoleId = roleList[0].Id; uObj.ProfileId = profileList[0].Id; uObj.IsActive = true; uObj.TimeZoneSidKey = 'GMT'; uObj.LanguageLocaleKey = 'en_US'; uObj.EmailEncodingKey = 'UTF-8'; uObj.LocaleSidKey = 'en_US'; uObj.IsActive = False ; userList.add(uObj);
insert userList;
Can you please Let me know if it helps or not!!!
If it helps don't forget to mark this as a best answer!!!
By Clicking the new user from UI it's not possible.
It's default checked as True by Salesforce.It's Standard field so it's not possible to edit property of that field
But you can use the Apex to insert the record as Inactive user i tried now it works . Try to execute the below code using devconsole or workbench.
Also try yourself with Process builder because i didn't tried to create the user by PB.
List<User> userList = new List<User>();
List<Profile> profileList = [Select Id from Profile where Name=: 'System Administrator' limit 1];
List<UserRole> roleList = [Select Id from UserRole where Name=: 'CEO' limit 1];
User uObj = new User();
uObj.LastName = 'MahaRaj';
uObj.Username = 'maharajancm@gmail.com';
uObj.Email = 'maharajansfdc@gmail.com';
uObj.Alias = 'mc';
uObj.UserRoleId = roleList[0].Id;
uObj.ProfileId = profileList[0].Id;
uObj.IsActive = true;
uObj.TimeZoneSidKey = 'GMT';
uObj.LanguageLocaleKey = 'en_US';
uObj.EmailEncodingKey = 'UTF-8';
uObj.LocaleSidKey = 'en_US';
uObj.IsActive = False ;
userList.add(uObj);
insert userList;
Can you please Let me know if it helps or not!!!
If it helps don't forget to mark this as a best answer!!!
Thanks,
Raj
All Answers
Mark as best answer, If it resloves !!
Please check these link
https://automationchampion.com/2015/06/11/getting-started-with-process-builder-part-28-auto-freeze-users-account/
Mark as resloved if it helps :) :)
Thanks,
Bhanu Prakash
visit ForceLearn.com (https://www.forcelearn.com/)
By Clicking the new user from UI it's not possible.
It's default checked as True by Salesforce.It's Standard field so it's not possible to edit property of that field
But you can use the Apex to insert the record as Inactive user i tried now it works . Try to execute the below code using devconsole or workbench.
Also try yourself with Process builder because i didn't tried to create the user by PB.
List<User> userList = new List<User>();
List<Profile> profileList = [Select Id from Profile where Name=: 'System Administrator' limit 1];
List<UserRole> roleList = [Select Id from UserRole where Name=: 'CEO' limit 1];
User uObj = new User();
uObj.LastName = 'MahaRaj';
uObj.Username = 'maharajancm@gmail.com';
uObj.Email = 'maharajansfdc@gmail.com';
uObj.Alias = 'mc';
uObj.UserRoleId = roleList[0].Id;
uObj.ProfileId = profileList[0].Id;
uObj.IsActive = true;
uObj.TimeZoneSidKey = 'GMT';
uObj.LanguageLocaleKey = 'en_US';
uObj.EmailEncodingKey = 'UTF-8';
uObj.LocaleSidKey = 'en_US';
uObj.IsActive = False ;
userList.add(uObj);
insert userList;
Can you please Let me know if it helps or not!!!
If it helps don't forget to mark this as a best answer!!!
Thanks,
Raj