Object expected

RAMP-NL

Object expected


You execute one of your scripts an get an "Object Expected" error like this:

What does this error mean?

You have probably referred to something in your script that does not exist. The most common cause of this error is simple typographic errors or even case errors.

These script lines:

 

NaVIGATE_TO_JUNCTION("uOS400MainMenu");

NAVIGATE_TO_JUNCTIN("uOS400MainMenu");

 

will both produce an "object expected" error. The reason is that no object named NaVIGATE_TO_JUNCTION or NAVIGATE_TO_JUNCTIN actually exists. The correct JavaScript function name is NAVIGATE_TO_JUNCTION (remembering that JavaScript is case sensitive).

Solution

When you get an "Object expected Error" try:

·         Checking the spelling of the name of object you are referencing.

·         Checking the case of the name of the object you are referencing (eg: Userprofile or UserProfile).

Sometimes it is hard to tell exactly which line in your script is producing an error.

The easiest way to resolve this is to make liberal use of the JavaScript alert function. For example:

 

alert("About to navigate");

NaVIGATE_TO_JUNCTION("uOS400MainMenu");

alert("Navigation finished");

 

 

Would fairly quickly isolate that the NaVIGATE_TO_JUNCTION() line was the one causing the script failure.