Skip to Content

Call a Script Within a Script

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?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Nov 01, 2017 at 09:56 PM

    Hello Brandon,

    check the sap script for generating a password. It should include other scripts. I'm not at work right now so I can't check the function to call a script, but it wasn't complicated.

    .

    Regards,

    Steffi.

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 02, 2017 at 12:11 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • 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.