Skip to main content
Nintex Community Menu Bar

Cascading Lookup Fails When Criteria Is Set Using Javascript

  • January 28, 2017
  • 6 replies
  • 20 views

Forum|alt.badge.img+3

Thank you in advance for any help you can offer.  Here is a description of the problem.

A List Lookup control has the following properties

197987_pastedImage_2.png

And it has these filter-by values

- Control: 'sltCompany'
- Column: 'lpCompanySpecific'

197988_pastedImage_3.png

Positive test works as expected...

- filter value = results

197990_pastedImage_5.png

Negative test works as expected…

- no filter value = no results

197989_pastedImage_4.png
…until I start setting the control value programatically using Javascript197991_pastedImage_6.png

After function set the control value,

no results are returned.

Even manually retyping the filter value,

the filter no longer works

197992_pastedImage_7.png

Reload the form,

manually type the filter value,

and the filter works again.

197993_pastedImage_8.png
Then execute the Javascript to override the typed control value...197994_pastedImage_11.png

...and again the filter no longer works,

even manually retyping the value,

no results

197995_pastedImage_12.png
Normal Javascript, nothing extravagant

197996_pastedImage_13.png

197997_pastedImage_14.png

197998_pastedImage_16.png

6 replies

rhia
Nintex Partner
Forum|alt.badge.img+15
  • Nintex Partner
  • January 28, 2017

Hi Neville Scheevel‌ !

I think this might solve your issue:    

Let me know if it works out!

Cheers,

Rhia


Forum|alt.badge.img+3
  • Author
  • January 28, 2017

I updated by code to this...

function SetCtrlValue () {
NWF$ ( '#' + ctrlCompany ).val( 'ABC Company' )
var ctrl = NWF$ ( '#' + ctrlCompany )
NWF.FormFiller.Functions.ProcessOnChange( ctrlCompany );
}

...and it produces the following Javascript error

198002_pastedImage_1.png


rhia
Nintex Partner
Forum|alt.badge.img+15
  • Nintex Partner
  • January 28, 2017

Hmm interesting! And this is On-Prem not O365, right?


Forum|alt.badge.img+3
  • Author
  • January 28, 2017

Correct, 2013 on-prem.


rhia
Nintex Partner
Forum|alt.badge.img+15
  • Nintex Partner
  • January 29, 2017

I think I got it!

function SetCtrlValue () {
NWF$ ( '#' + ctrlCompany ).val( 'ABC Company').trigger('change');
 }

Try this out happy.png This worked for me in my trials.

Cheers,

Rhia


Forum|alt.badge.img+3
  • Author
  • January 30, 2017

Brilliant! That fixed it! Thanks so much!