Page 1 of 2

Type ahead works in Quick Edit but not in "New Form"

Posted: 21 Mar 2019
by dominique.beaudin
Hello,
I created a new lookup (in order to take advantage of "type ahead") and it is working perfectly when I select "quick edit" for the list and do the "type ahead"

However, when I use the "new" form (using SPforms) I get a "loading failed" when I do the type ahead. The list does initially load and can be scrolled normally.

I did not add any custom code in Plumsail lookup.

Any help is appreciated.

Re: Type ahead works in Quick Edit but not in "New Form"

Posted: 22 Mar 2019
by AlexZver
Hi!

Could you clarify please, how many items do you have in the lookup field?

Re: Type ahead works in Quick Edit but not in "New Form"

Posted: 22 Mar 2019
by dominique.beaudin
Hi!
There are about 400 items

thank you!

Re: Type ahead works in Quick Edit but not in "New Form"

Posted: 25 Mar 2019
by Nikita Kurguzov
Dear Dominique,
There is most likely an error in the request code. Please, go to Cross-site Lookup configuration and send us the code that you have in Advanced Settings -> Request Items:
RequestItems.png
RequestItems.png (24.91 KiB) Viewed 1826 times
Please, also show us the error that you get in browser's console fully (whole text):
FDForumErrors.png
FDForumErrors.png (81.73 KiB) Viewed 1826 times

Re: Type ahead works in Quick Edit but not in "New Form"

Posted: 26 Mar 2019
by dominique.beaudin
Here is the request items code (did not change it)
function (term, page) {
if (!term || term.length == 0) {
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField}&$orderby=Created desc&$top=10";
}
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField}&$orderby={LookupField}&$filter=startswith({LookupField}, '" + encodeURIComponent(term) + "')&$top=10";
}

Re: Type ahead works in Quick Edit but not in "New Form"

Posted: 26 Mar 2019
by dominique.beaudin
here is a snip of the full console
console.PNG
console.PNG (48.8 KiB) Viewed 1825 times

Re: Type ahead works in Quick Edit but not in "New Form"

Posted: 26 Mar 2019
by dominique.beaudin
another note, it DOES populate if i just scroll through. Only the "type ahead" does not work. So Strange. I am doing the lookup from a calculated field... does that matter (2 text strings concatenated so they can see the name and status of the item) thank again.

Re: Type ahead works in Quick Edit but not in "New Form"

Posted: 26 Mar 2019
by Nikita Kurguzov
Dear Dominique,
What type of field are you using for the lookup? Some fields might simply not support filtering, but work normally otherwise.

P.S. Sorry for the question, I've read that you've mentioned that it's a calculated field - these are not supported by REST API for filtering, unfortunately. Now, there might be an option to configure filtering when searching, even by two separate fields, but I'll have to look into it tomorrow.

Re: Type ahead works in Quick Edit but not in "New Form"

Posted: 26 Mar 2019
by dominique.beaudin
Thank you!

Re: Type ahead works in Quick Edit but not in "New Form"

Posted: 26 Mar 2019
by dominique.beaudin
If it was possible to just have another field populate the form when the name was looked up from the same list, that would work too. I was just trying to keep it simple.