Another look-up-issue
Hello,
I’m new to SPForms and Cross-Site-Lookup. We use SP2013. I have managed to build the Country – Office-Example of cascaded-lookup and wanted to change it for my purpose. But I have some trouble.
I have one list „Questions“ with a field „Theme“ and a field „Person“. The field „Theme“ is a lookup from a list „Themes“/field „Theme“. The field „Person“ is a lookup from a list „Persons“/field „Name“. In the list „Persons“ is another lookup to list „Themes“/field „Theme“, where every Persons gets one Theme.
When I pick a „Theme“ in list „Questions“ I want the lookup-field „Person“ in list „Questions“ to show only people from list „Persons“ with the theme picked in list „Questions“.
I get the message „Loading failed“ and can`t figure out why. The alert-window returns the correct ID from List „themes“. All lookups are maade with cross-side-lookup.
My code so far:
function (term, page) {
var ThemeId = fd.field('Theme').value();
alert(ThemeId);
if (!ThemeId) {
ThemeId = 0;
}
if (!term || term.length == 0) {
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField},Theme/Id&$orderby=Title asc&$expand=Theme/Id&$filter=Theme/Id eq " + ThemeId +"$top=10";
}
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField}&$orderby={LookupField}&$filter=startswith({LookupField}, '" + encodeURIComponent(term) + "')&$top=10";
}
Thank for helping .....
I’m new to SPForms and Cross-Site-Lookup. We use SP2013. I have managed to build the Country – Office-Example of cascaded-lookup and wanted to change it for my purpose. But I have some trouble.
I have one list „Questions“ with a field „Theme“ and a field „Person“. The field „Theme“ is a lookup from a list „Themes“/field „Theme“. The field „Person“ is a lookup from a list „Persons“/field „Name“. In the list „Persons“ is another lookup to list „Themes“/field „Theme“, where every Persons gets one Theme.
When I pick a „Theme“ in list „Questions“ I want the lookup-field „Person“ in list „Questions“ to show only people from list „Persons“ with the theme picked in list „Questions“.
I get the message „Loading failed“ and can`t figure out why. The alert-window returns the correct ID from List „themes“. All lookups are maade with cross-side-lookup.
My code so far:
function (term, page) {
var ThemeId = fd.field('Theme').value();
alert(ThemeId);
if (!ThemeId) {
ThemeId = 0;
}
if (!term || term.length == 0) {
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField},Theme/Id&$orderby=Title asc&$expand=Theme/Id&$filter=Theme/Id eq " + ThemeId +"$top=10";
}
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField}&$orderby={LookupField}&$filter=startswith({LookupField}, '" + encodeURIComponent(term) + "')&$top=10";
}
Thank for helping .....
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Hi,
Your case is really similar to the case described in our blog:
http://spform.com/forms-designer- ... office-365
Make sure that you're using the correct internal names of fields. If it does not help, open the browser console (F12) and check JS-errors and notifications.
Your case is really similar to the case described in our blog:
http://spform.com/forms-designer- ... office-365
Make sure that you're using the correct internal names of fields. If it does not help, open the browser console (F12) and check JS-errors and notifications.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 5 guests