Solved

Getting error 'NWF$' is undefined when calling NWF in developer tools on my form

  • 8 December 2015
  • 6 replies
  • 181 views

Badge +5

I'm trying to write some JavaScript against my Nintex Form but can't access NWF$ or $, I get the error 'NWF$' is undefined, and when I access $ all objects just return null.

 

Am I just doing something silly? I have a 30 day trial account.

 

Help appreciated happy.png I have attached a screenshot.

icon

Best answer by rebecca_gordon 15 December 2015, 09:40

View original

6 replies

Userlevel 7
Badge +17

When are you getting the context to act upon the form? I would check out the post Using JSOM in Nintex Forms for O365​ as a start to get things connected. Let us know if this helps.

Badge +5

I'm waiting till page has fully loaded and running code with developer tools. I had a look at the post you linked, I can't even see NWF object. I've logged a support call, hopefully it's just something silly I'm doing and not a corrupt environment or something will post what comes back from support.

Badge +5

Thanks everyone for responses.

I made sure I was selecting objects inside the iframe with the dom selector before running code in the console, still no luck .

Badge +5

Hey everyone,

So after some more investigation, I have tested that the code is fine when you insert it into the form and run the form. It just doesn't work with developer tools. There may be a way to still debug it, but selecting the iframe and running the code doesn't work.

I'll post again when I find out more information. For now the workaround will be to develop and debug through Nintex, which is a pain having to publish each time and debug through alerts and logs haha. Other options is to save the file in SharePoint (permissions allowing) or to a CDN.

Badge +5

Hey everyone,

So I finally figured out that if you set a breakpoint in your code, you can run commands against the console. Usually when I'm just writing some quick JQuery and checking whether my selections are correct e.g. NWF$('.jsLeaveDuration').find('label').html(); I will write it into the console once the page has loaded, without debugging.

Must be because it's in an iFrame and without setting a breakpoint, the console window doesn't run against what is in the iFrame because it's not inside that scope?

Interesting...

Badge +5

The original question wasn't really answered, but I have marked my workaround as the response to help with people finding answers for the same issue

Reply