On an onchange event on a select box (filtered lookup column where the value is the item ID) i make an AJAX call to auto fill certain fields on a form.
This works great except for it only returns 100 items (currently the list is pushing 200 items) and as such often a person will select an item for it then to do nothing. I am new to AJAX/REST and can not tell what I need to change.
Code:
var requestUri = _spPageContextInfo.webAbsoluteUrl +
"/_api/Web/Lists/getByTitle('Traveller Details')/items";
// execute AJAX request
$.ajax({
url: requestUri,
type: "GET",
headers: { "ACCEPT": "application/json;odata=verbose" },
success: function (data) {
//loop
var i = 0;
$.each(data.d.results, function (index) {
var e = document.getElementById("ctl00_ctl45_g_c16cce21_47f1_40fc_ab50_f38e7df1b86c_ff931_ctl00_Lookup");
var strUser = e.options[e.selectedIndex].value;
i++; //Counter i used to find out that it is exactly 100
//If account found
if ($(this).attr('ID') == strUser) {
//Sets field attributes here.