cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Does anyone know how to call a JavaScript from within a JavaScript?

I have two scripts in my job, one local and one global. I want the global script to give me a result and populate a target in my database table and I want my local script to take that result and run a SQL query on it. I'm using a From LDAP pass so I cannot just wrap the function call inside another function call. From LDAP passes have a column specifically for the scripts so you can only use one per line.

So again, anyone know how to do this, call a script from inside a script?

0 Likes
View Entire Topic
devaprakash_b
Active Contributor
0 Likes

Hi Brandon,

Supposer you are inside script A. call the script as below

function ScriptA(Par)

{

//Calling script B

//if script b returns any values then user below syntax

var res = scriptB(Par); or UserFunc.scripB(Par)

//if script b doesn't return any values then user below

scriptB(Par); or UserFunc.scripB(Par)

}

Regards,

DP

brandonbollin
Active Participant
0 Likes

I tried the:

var res = scriptB(Par);

That is producing an error. Maybe adding the, "UserFunc" in front of the script will make a difference. I will try that and report back. Thanks.