Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
osasa541
Contributor
Contributor

Fallo al cargar variables desde una función. // Failed to load variables from a function.

Hola, tengo el siguiente problema para el que después de mucho tiempo, no logro encontrar una solución.

Tengo una función(jscript), en la cuál cargo datos llamando a una variable del sistema con 

'ActiveDocument.GetVariable("myVariable").GetContent().String '

Cuando llamo a la función desde un botón, el proceso funciona sin problema, pero al llamar a la función desde el script de carga, la función falla.

 

function MyFunction ()  {
var sms=new ActiveXObject("WScript.Shell");
var vStrMapID = new Array ();
var ArrayId = new Array ();
var k,z;
z = 3;
for ( k=1; k<=z; k++) {
vStrMapID = "vArray_" + k;
sms.popup(vStrMapID);
ArrayId [k] = ActiveDocument.GetVariable(vStrMapID).GetContent().String;
sms.popup(ArrayId [k]);
}
return 5;

}

 

adjunto el código del script de carga, desde donde llamo a la función

for a = 1  to  3
let vArray_$(a) = 'Valor_'& $(a);
next

let MiValor = MyFunction();

 

¿Alguien sabe por que puede estar fallando?

Gracias!

 

 

 

 

 

Hello, I have the following problem for which after a long time, I cannot find a solution.

I have a function(jscript), in which I load data by calling a variable of my data model

'ActiveDocument.GetVariable("myVariable").GetContent().String '

When I call the function from a button, the process works fine, but when I call the function from the load script, the function fails.

 

function MyFunction ()  {
var sms=new ActiveXObject("WScript.Shell");
var vStrMapID = new Array ();
var ArrayId = new Array ();
var k,z;
z = 3;
for ( k=1; k<=z; k++) {
vStrMapID = "vArray_" + k;
sms.popup(vStrMapID);
ArrayId [k] = ActiveDocument.GetVariable(vStrMapID).GetContent().String;
sms.popup(ArrayId [k]);
}
return 5;

}

 

I attach the code of the load script, from where I call the function

for a = 1  to  3
let vArray_$(a) = 'Valor_'& $(a);
next

let MiValor = MyFunction();

 

Does anyone know why it doesn't work?

 

 

Thanks in advance!

 

 

Labels (2)
0 Replies