Access VisualNEO web vars from plugin? - Forum

Forum Navigation
You need to log in to create posts and topics.

Access VisualNEO web vars from plugin?

Hi Everyone

Not sure if this has been covered but cannot find it, I wish to access vars from Vneo from within a plugin, I know how to return values with parameters but I have a Promise in plugin that accesses 3 Tables in a Db and wanted to make sure that I have the results from all 3 before returning the result back to the calling program, I can print the results out to console ok.

Using a return after a Promise.all[] I get 'undefined' back because I expect that the calling program finishes before the Promise.all[] finishes.

I have looked into $scope. but I think this only works within Vneo with BeginJS EndJS.

I know I am probably missing something simple but any help greatly appreciated.

 

I think I have found my mistake, I was trying to access the var from plugin with  as the help describes

SetVar [myvar] "Hi!" //in calling program

Plugin::  alert($App.myvar); //could not get this to work

but if I assign the variable in the plugin as::

$App.myvar = "Hi!";

it updates perfectly in calling program

I found my mistake with the

SetVar [myvar] "Hi!"
  alert($App.myvar);
in the plugin,

not working, I had not created an object in the calling program with that variable attached, I created
a textInput with [myvar] as variable and now it works, silly me :)

and thanks again Luis for a fantastic product.

luishp and YASIN have reacted to this post.
luishpYASIN

I also needed to pass in a variable that would work like the 'SetCompVar' ,

SetVar [num] "1"
SetCompVar [myvar[num]] "Hi! It works"

It worked like this::
var num = 1;
$App['myvar'+num] = "Hi! It works";
and this updates calling program [myvar1].

Can also use
$App['my'+num+'var'] = "Hi! It works";
to update [my1var].

Hope this helps someone.

 

luishp has reacted to this post.
luishp