I am performing a database lookup into a drop down list when the form loads. Because nothing has been selected yet the value of that control is null or empty, which I have confirmed with a calculated field that has this formula (it shows 'Empty'):
However, when I use the same IsNullOrEmpty fuction in another calculated control in which the following calculation is done on the FALSE condition:
+ ' ' +
I get this error: "Unable to get property 'split' of undefined or null reference. Am I doing something wrong in this formula? I know that manager is null or empty when the form loads, which means that the split function should not be called until I actually select something. Yet is seems to be executing, or trying to, even though I'm stipulating that it not be run unless the manager control is neither null nor empty.
Thanks, in advance,
Solved! Go to Solution.
could you try following?
update your formula like this:
+ ' ' +
console.log('lookup val-<'+val + '> len='+val.length+' isnull='+isnull);
I would be really interested in what will appear on console...
(unfortunately I do not have possibility to test it on my own)
Thanks for the reply but not much information there. All I get is a bunch of permission denied errors:
SCRIPT70: Permission denied
File: NewForm.aspx, Line: 19, Column: 1
hm, I would say this is not related to the code I suggested to add.
what is line 19 about?
typically there are plenty of script includes at the beginning of NewForm.aspx, so it looks like you are trying to include a script/resource that you do not have permissions for.
I have created a brand new list and get exactly the same error message. It doesn't seem to matter whether I put that formula in a calculated control or a form variable.
Adding the code you suggested also gives me the same error I reported above. Here is a screen shot.
so as I suspected, you do not have permissions to load (or a file doesn't exists) init.js script.
but maybe later on another init.js script with another locale might be loaded, so it need not be an error to care about.
I would still check console window (not script itself) whether it gives some output
After further study it appears that the problem I'm experiencing is NOT with the IsNullOrEmpty() runtime function, which works just fine, and not with the If() function, which also works. I suspect that the parseLookup function must always run no matter what, ignoring the surrounding logic that would tell it not execute.
hm, that's really interesting finding....
I've setup small testcase and can confirm the behavior as well.
ie., whichever out of three 'slt1' text field,' lkp1' or 'lkp2' lookups I have changed, parseLookup() from both branches were invoked
which version of Nintex Forms are you using? I've got a similar issue with calculated fields and if condition, where both the branches were invoked.
I've opened a ticket and the issue has been solved with the last version of Nintex Forms 2.9 that has come out lastJune 20th, so if you're not on the last version I suggest you to try to update (have a look also on the other posts here on the forum about the changes in the lookup controls)