validation using 'undefined'

It was suggested to me that I could use

If ([formname]) = undefined) 

to see if a form exists (ie that the module is loaded). However I get this message when I attempt to use the above code.

java.lang.RuntimeException: Can’t put in a locked scope, name: [formname], value: org.mozilla.javascript.Undefined@345076 ([methodname], line 8)

The senario is…I have a solution with this basic setup:

  • one controller module
  • multiple dept modules - these each have ‘controller’ defined as a module w/i them
  • wrapper solution - each of the dept are defined as modules w/i the wrapper
    When developing in the dept modules, I need the controller to still function. So I need to capture instances where it would goto a form in the wrapper (which is not loaded when developing in the dept modules) and goto another form instead.

Suggestions on why my code doesn’t work or another way I might accomplish this?

Typo correction to code above

If ( [formname] = undefined)

I think that would need to be

if([formname] == undefined) or 
if([formname] != undefined)

hth

Gets me everytime!

Thanks :oops: