Skip to main content

I Have a drop down list in my Nintex form, Which is populating data from another site SharePoint List using Sp services. I have a hidden text box which is capturing drop down value and connected to list column .  I am not able to save the item, after clicking on save it is redirecting it error page.

Added choice control , Named it as ddlMD (fromat is Drop down list)

Added Single Line text box which is hidden , Named it as txtMD

Could you please any one suggest me what I am doing wrong here.

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

setDropDown();

var dropdown;

dropdown = NWF$("#" + ddlMD);

dropdown.change(refreshddlMD);

});

function setDropDown()

{

var fullWebUrl = "https://test.com/sites/sample/"

var option = '<option value="">Select</option>';

//CAMLQuery: "<Query><Where><Eq><FieldRef Name='ID'/><Value Type='Number'>3</Value></Eq></Where></Query>",

NWF$().SPServices({

   operation: "GetListItems",

   async: false,

   webURL:fullWebUrl,

   listName: "Test",

   CAMLViewFields: "<ViewFields><FieldRef Name='Title'/><FieldRef Name='ID'/></ViewFields>",

 

   completefunc: function(xData, Status)

   {                   

      NWF$(xData.responseXML).SPFilterNode("z:row").each(function() {

            var title = ($(this).attr("ows_Title"));

         var Id=      ($(this).attr("ows_ID"));

           

option += '<option value="' + Id  + '">' + title  + '</option>';

});

       $('#'+ddlMD).find('option').remove().end().append(option);

}

     

});//getListItems

}//Set Dropdown

function refreshddlMD()

{

     NWF$("#" + txtMD).val($('#'+ddlMD + ' :selected').text());

    NWF$("#" + ddlMD).prop('selectedIndex', 0);

    alert(NWF$('#' + txtMD).val())

}

does any errors appears on developer console?

on error page there should be a correlation ID that points you to respective errors in ULS log. have you check that?

btw, any good reasons why you do it this complicated way and do not use built in lookup control (and possibly directly lookup column in list)?


Reply