Error running RAMP in end-user mode (UF_EXEC) but not in design mode (UF_DESGN)

RAMP-NL

Error running RAMP in end-user mode (UF_EXEC) but not in design mode (UF_DESGN)


You can run your RAMP application in Design mode but you get an error like this when you try to run it in End-User mode:

Why does this problem happen?

The main difference between running RAMP in design mode and running it end-user mode is the way javascript is executed.

In design mode, javascript is reloaded each time the Framework is saved if there has been a change affecting RAMP. Each time the javascript is reloaded, the object properties are re-set. And each time the Framework is saved, if RAMP is enabled and has changed, a set of javascript files called <system prefix>Nodes_nnnnnnnnnnnnnnnnnn.js are generated, one for each session where the nnnnnnnnnnnnnnnn part is the session identifier.

These files are the ones used in end user mode. They represent the screens and scripts written out as javascript at the time the Framework was saved.

In end-user mode, these files are loaded once for each session. Each one of the javascript functions in the file is called only once during session start up. This method speeds up the start up time of RAMP in end-user mode considerably as opposed to design time.

When RAMP is executed without errors in design mode but with errors like the above in end-user mode, the prime suspect is a syntax error in the user-defined scripts (be it navigation scripts, invoke, etc).

 

Solution

To find out what line of javascript has the error, you can simply load the file into a basic .HTM file.

For example create a file called test.htm with content like this:

 

<html>

<head>

<title>Untitled Page</title>

<script language="javascript" type="text/javascript" src="<your nodes.js file here>"></script>

</head>

<body>

Hello World

</body>

</html>

 

Specify the name of your nodes.js file in the src= attribuite of the <script> tag and put Test.htm in the same folder as the javascript.

Using Internet Explorer, check your Advanced settings tab under Tools/Internet options to verify you have the "Display notification about about every script error" checked. You can then run Test.htm and you should get a script error showing the line number where the error has occured. Tip: the error is most likely to be inside a javascript function called something like this:

 

function __UF__nnnnnnnnnnnnnnnnnnnnnnnn(objScriptInstance)

which makes it a bit hard to correlate it with the actual script name. To find out exactly what this script is, do a Find in the same file of the nnnnnnnnnnnnnnnn part of the function name. You should then locate the lines of javascript that define that script as an object and that will have the user name (for example oS.uScriptUserName="NAVIGATE_SCRIPT_13";)

Edit the script using the RAMP tools, correct the error and save.