Highlighted
Absent Member.
Absent Member.
1688 views

Global variable value from javascript array

Jump to solution

hi all,

in DO under preRAD javascript RAD iadded script and in incident(probsummary) object i added global variable named $G.assignoperators.

Now i want,whole array information from javascript array to be sent to global variable.

something like that

system.vars.$G_assignoperators = operator[i]


how to achieve this?

0 Likes
1 Solution

Accepted Solutions
Highlighted
Absent Member.
Absent Member.

hi ,

found solution.

use it like

$G.variable = jscall(scriptname.functionname)

no need to send value seperately as operator[i].

operator[i] will send value one by one ,but $G.variable is set once i need to copy whole operator[] array

 

that is pretty default. $G.variable = jscall(scriptname.functionname)

 

and return opertor in javascript

View solution in original post

0 Likes
2 Replies
Highlighted
Absent Member.
Absent Member.

The other way around would be easier - just a toArray() function to transform a SM array to a JS array.

 

From JS to SM, I believe you will have to run through a loop like this:

var operator= new Array();
var ind = 0;
while(operator[ind] != null)
{

system.vars.$G_assignoperators[ind+1] = operator[ind];

(or better system.vars.$G_assignoperators=system.functions.insert(system.vars.$G_assignoperators,operator[ind],ind+1,1)

ind++;
}

 

I have not checked the syntax, but in theory that is how it should work.

0 Likes
Highlighted
Absent Member.
Absent Member.

hi ,

found solution.

use it like

$G.variable = jscall(scriptname.functionname)

no need to send value seperately as operator[i].

operator[i] will send value one by one ,but $G.variable is set once i need to copy whole operator[] array

 

that is pretty default. $G.variable = jscall(scriptname.functionname)

 

and return opertor in javascript

View solution in original post

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.