javascript button in a grid application - how to access [global_variable]?

I have a grid application and i also created a javascript button.

in the button’s javascript code, I attempted this

var java_variable = [global_variable];

but it doesn’t work.

how can i resolve this?

Giu,

is the second screenshot correct?

You’re passing ‘IN_var’ to the JS function but you’re assigning an hardcoded value to ‘testing’ (987654).

Shouldn’ it be like this?:

testing = IN_var;

Giu,

i’m using a grid application, so javascript methods do not exist.
hoping to find a way to in javaascript to get the global variable…

Yes robydago, I was just testing and forgot to update the screenshoot.

Demund, instead to create the function in JS functions, echo it onApplicationInit

I like this function for access global variable. in my case, my way for do it was: create a new field and assign the global variable and then javascript can acces to field.

of course, your option is another valid way to do it