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

Discussions about Cross-site Lookup
User avatar
dominique.beaudin
Posts: 49
Joined: Tue Mar 06, 2018

21 Mar 2019

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.
Attachments
loading failed.PNG
loading failed.PNG (76.57 KiB) Viewed 8106 times

User avatar
AlexZver
Posts: 232
Joined: Mon Aug 27, 2018

22 Mar 2019

Hi!

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

User avatar
dominique.beaudin
Posts: 49
Joined: Tue Mar 06, 2018

22 Mar 2019

Hi!
There are about 400 items

thank you!

User avatar
Nikita Kurguzov
Posts: 889
Joined: Mon Jul 03, 2017

25 Mar 2019

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 8095 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 8095 times
Cheers

User avatar
dominique.beaudin
Posts: 49
Joined: Tue Mar 06, 2018

26 Mar 2019

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";
}

User avatar
dominique.beaudin
Posts: 49
Joined: Tue Mar 06, 2018

26 Mar 2019

here is a snip of the full console
console.PNG
console.PNG (48.8 KiB) Viewed 8094 times

User avatar
dominique.beaudin
Posts: 49
Joined: Tue Mar 06, 2018

26 Mar 2019

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.

User avatar
Nikita Kurguzov
Posts: 889
Joined: Mon Jul 03, 2017

26 Mar 2019

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.
Cheers

User avatar
dominique.beaudin
Posts: 49
Joined: Tue Mar 06, 2018

26 Mar 2019

Thank you!

User avatar
dominique.beaudin
Posts: 49
Joined: Tue Mar 06, 2018

26 Mar 2019

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.

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests