if I know the login in user ID, how do I get his identity?
Thanks
Qiaoyun
if I know the login in user ID, how do I get his identity?
Thanks
Qiaoyun
I wished Aras would have a standard function for this common task. But they haven´t. You have to do this with AML:
// Get user Alias Identity
Item alias = inn.newItem("Alias","get");
alias.setProperty("source_id",inn.getUserID());
alias.setAttribute("select","related_id");
alias = alias.apply();
string identity = alias.getProperty("related_id");
Thank you so for your reply. I found out that there is a relationship "Alias" connect "User" and "Identity" Will test it.
Best!
Thank you this time AngelaIp!
Some update to this one, cause this post is about a common task everybody needs to solve sometimes.
Even if an Aras employee (Chris "the saint" ) and many other liked my code sample, I wonder if we all have overseen a better solution.
Doesn´t inn.getUserAliases()); do pretty much the same?!?!? Does anyone know more? I am so confused right now.
In C# there is
string aliasId = Aras.Server.Security.Permissions.Current.AliasIdentitiesList;
But you would probably need to check if it contains exactly one id, since it is a "List".
In Javascript there is:
aras.getIsAliasIdentityIDForLoggedUser()
Hi Alderaan,
many thanks for the examples! I like both variants and will definitely use them!
I know that the question is a little bit old, but in the newer versions you can try this code (for C#)
string userIdentityId = CCO.Identity.GetIdentityIdByUserId(inn.getUserID());
That´s an excellent one - thank you!!! Seems to be a very uncommon function, I just found one reference in Innovator at all. But it´s so obviously useful! Finally somebody found the solution to a 5 year old puzzle!!
Copyright © 2024 Aras. All rights reserved.