Skip to main content

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

Hi Neville Scheevel‌ !

I think this might solve your issue:    

Let me know if it works out!

Cheers,

Rhia


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


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


Correct, 2013 on-prem.


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


Brilliant! That fixed it! Thanks so much!


Reply