Type ahead works in Quick Edit but not in "New Form"
- dominique.beaudin
- Posts: 49
- Joined: Tue Mar 06, 2018
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.
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 (76.57 KiB) Viewed 8106 times
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
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: Please, also show us the error that you get in browser's console fully (whole text):
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: Please, also show us the error that you get in browser's console fully (whole text):
Cheers
- dominique.beaudin
- Posts: 49
- Joined: Tue Mar 06, 2018
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";
}
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";
}
- dominique.beaudin
- Posts: 49
- Joined: Tue Mar 06, 2018
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.
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
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.
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
- dominique.beaudin
- Posts: 49
- Joined: Tue Mar 06, 2018
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.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 3 guests