Absent Member.
Absent Member.
7271 views

Give a specific role the current user value


Hi,

I would like to know if there was an easy way to set with JAVASCRIPT an value of a Specific user with the value of current user ?

Thanks for support !
0 Likes
4 Replies
Highlighted
Absent Member.
Absent Member.

Re: Give a specific role the current user value


Ok this question was already posted on this forum ... sorry !!

If anyone need the answer : http://knowledgebase.serena.com/InfoC.

Thanks !
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Give a specific role the current user value


You can also set this variable with a pre-transition AppScript



call ext.writeStream("<script type='text/javascript'> var currUserName= " & chr(34) & shell.User.getName() & chr(34) & ";</script>")



Wrapping the username in chr(34)'s (double-quotes) is to avoid problems if users have an apostrophe in their name.
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Give a specific role the current user value


I think the current user id is already defined as a Javascript variable, like this:

var userID = "2";

var app = "Application";

var currentSolution = 1;

var external = false;

var dll = "tmtrack.dll?";


0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Give a specific role the current user value


Yes, if they are looking for the current user ID it's easy to get this way, but I though they were looking for the current user Name (that's the example in the linked KB article). It would be a nice enhancement if the user Name were automatically included as a variable on all pages as well. You can parse it out from the "Welcome, Some User" string in the upper-left of the page, but that's not guaranteed to be there (if the full user interface is not shown)
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.