Set Lookup control value by JS

  • 24 February 2022
  • 1 reply
  • 194 views

We have look up field which always has one value as its option. The goal is to the only option automatically in the dropdown. 

 

Using JavaScript we have managed to visually set the lookup dropdown control to automatically display the only option. However, when saving the form the control value is not saved to the connected SP field.

 

Lookup value is saved correctly in SP Field if selection is done manually.

Someone else encountered similar behaviour and any solutions to this unusual behaviour?


1 reply

Badge +9

You need to trigger a focusout event for the control or use NWF.FormFiller.Functions.ProcessOnChange:


 



yourCtrl.trigger("focusout");



NWF.FormFiller.Functions.ProcessOnChange(yourCtrl);



Reply