I use JavaScript in a Nintex form to automatically setup a value in a lookup. It works. After upgrading from 2.8.1 to 2.9.2.10, it stopped working.

  • 2 August 2016
  • 4 replies
  • 34 views

Badge +3

Hello,

I use JavaScript in a Nintex form to automatically setup a value in a lookup (drop down list). It works.

After the Nintex form is upgraded from 2.8.1 to 2.9.2.10, this piece of the custom JavaScript code stopped working and can't set up the value in the lookup automatically.

The code likes below,

NWF$(document).ready(function() {

NWF$(document).on('change', '#' + DivisionDirector1, function () {

  var DivisionDirector1idLen = NWF$("#" + DivisionDirector1).find("option").length;

  if (DivisionDirector1idLen === 2) {

   NWF$("#" + DivisionDirector1).val(NWF$("#" + DivisionDirector1).find("option")[1].value);

  NWF$("input#" + DivisionDirector1).val(NWF$("#" + DivisionDirector1).find("option")[1].value);

  }

});

});

Do you have any suggestions about it?

Thank you,

Yong


4 replies

Userlevel 4
Badge +11

Hi,

in the release notes of version 2.9.2.0 there is this advice:

This release includes a new version of the List Lookup control. Changes to be aware of:

  • Custom validation (JavaScript) may require updating due to changes. The control now returns ID and Value where as previously it only returned ID
  • The display format has change in the settings

I think that you have to check if the new format of the list lookup control works well with your javascript that sets a value, probably you have to change something in the value you pass in order to reflect the new settings.

Giacomo

Badge +3

Thank you Giacomo!

When you say:

...new format of the list lookup control works well with your javascript that sets a value, probably you have to change something in the value you pass in order to reflect the new settings.

Can you please explain a little bit more in detail about "change something in the value you pass in order to reflect the new settings."

Thanks again!

Yong

Userlevel 4
Badge +11

unfortunately I don't currently have an environment with the latest version installed, but from what I've seen in other post here on the forum, now the lookup values have a value written as "ID#;DisplayValue" and not anymore only "ID", so if you were setting the field passing only a value like "ID" now it probably doesn't work..

Sorry but I can't help you more in detail, except from suggesting you to try to inspect the html code of the lookup control and try to log the value your setting in order to troubleshoot it.

Giacomo

Badge +1

Can you please explain how to connect external list to List Lookup control.

I have Customer_ID (PK) and Customer_Name which i would like to display in dropdown list

I can show Value but ID remains '0' for all items in dropdown? any reason in external list connection? Nintex control

I dont have ID coloumn for this sharepoint external list.

In the external list view i have 'BDCIdentity' but doesnt work.

Reply