loadScript()

The JavaScript file is loaded and merged with the main script.

Example using loadScript():

env.loadScript(strPath, strDesc, uuiScript);

Example using loadScript():

env.loadScript(filScript, strDesc, uuiScript);

Parameter

Description

strPath

The string path that is used to locate the script file

filScript

The file object that references the JavaScript file

strDesc

Optional: The description that enables logging and debugging to identify whether an error occurred in the main script or a loaded script

uuiScript

Optional: The UUID of the script being loaded

Example 1: Use the string to search for the file in the same location as the script. If it fails to locate the file it searches the root of the script repository folder: in EPM Workspace the root is /Administration/Impact Manager/Script Repository, and on the desktop it is C:\Hyperion\products\biplus\DDS\scripts.

env.loadScript(“lib_hysl_core.js”);

Example 2: Use the file object (env.loadScript(filScript, strDesc, uuiScript);) to implement a similar mechanism to Example 1.

function _loadScript(in_strScript){
    var uuid, fil
    var folServer = "/Administration/Impact Manager/Script Repository/lib/"
    var folDesktop = "C:\\Hyperion\\products\\biplus\\DDS\\scripts\\"
    if (env.isServerMode()){
       uuid = cn_repLocal.getFileUuid(folServer + in_strScript) 
    } else {
        uuid = folDesktop + in_strScript
    }
    fil = cn_repLocal.retrieveFile(uuid)
    env.loadScript(fil, in_strScript, uuid)
}
_loadScript("lib_hysl_core.js");