Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear All,
My objective is to use the logged in user name into a QV Extension. For that I have declared a variable through Variable Overview dialogue as : vLoggedinUser =OSUser()
Have checked that the value of the variable showing correctly in a standard QV text object as <domainname>\<username>.
Now want to take this value in an extension object, so have written the following code block in Script.js file :
/*setting VariABLES*/
var _this = this;
var vUser ;
_this.StaticPros = {};
_this.StaticPros .UserName = eval('_this.Layout.Text0.text');
var qvDoc = Qv.GetCurrentDocument();
qvDoc.GetAllVariables(function (vars) {
if (vars != null) {
for (var i = 0; i < vars.length; i++) {
var obj = vars;
if ((obj.isreserved == "false") && (obj.isconfig == "false")) {
if (obj.name.toLowerCase() == _this.StaticPros .UserName.toLowerCase()) {
vUser = obj.value.toString(); //return variable definition text
//[i.e =OSUser() , should return <domainname>\<username>]
//vUser = obj.name.toString(); //return the name of the variable [i.e vLoggedinUser ] correctly
}
}
}
}
});
vUser = obj.name.toString(); returns the name of the variable [i.e vLoggedinUser ] which is perfect.
But, vUser = obj.value.toString(); returns variable definition text [i.e =OSUser() ] which is wrong. It should return <domainname>\<username>].
Can anyone point me if I am missing anything or any better idea ? Would appreciate your help.
Regards,
Som
Dear All,
Has anyone faced this problem ?
Regards,
som
in Definition.xml add:
<Text Label="OSUSER" Type="text" Initial="" Expression="=OSUser()"/>
then in the javascript reference it by:
_this.Layout.Text0.text