05-11-2018 07:04 AM
Hello,
I have a string variable in script which contains username.
I need to check if this user is exists in OnBase. If not then create that user and add that in specific user group. I am not sure how to accomplish that.
Here a code not sure if it is a correct approach .
string tryuser="ABCD";
Hyland.Unity.User user=app.Core.GetUser(tryuser); //check if user is in OnBase
if(user==null)
{
//Create a new user and add that user in Usergroup1
}
Thanks!
05-11-2018 04:46 PM
Hi Pallavi,
Instead of using app.Core.GetUser() method, I recommend UserAdministration.GetUsers() method to get a UserList object, and from this list object, find the specific User object you are looking for. The GetUsers() method can also take in a UserGroup object as a parameter, so you only get a list of users from that specific usergroup.
And the UserAdministration class has the functionality of creating new users and adding them to usergroups as well.
05-11-2018 04:46 PM
Hi Pallavi,
Instead of using app.Core.GetUser() method, I recommend UserAdministration.GetUsers() method to get a UserList object, and from this list object, find the specific User object you are looking for. The GetUsers() method can also take in a UserGroup object as a parameter, so you only get a list of users from that specific usergroup.
And the UserAdministration class has the functionality of creating new users and adding them to usergroups as well.
05-17-2018 06:36 AM
05-17-2018 06:48 AM
05-17-2018 04:14 PM
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.