Filter Cross site lookups - Loading failed
This is going to be my last question for some time - I Promise
I've read through the article on Filter Cross site lookups and I think I have everything correct. However I can't see what I'm doing wrong.
I have a List in a site called personnel
in that list I have Employee Name and Department.
In a Subsite I have a list that contain cross site look ups for both these field (in the sub site the columns have the same name)
In my form designer I have these two CS Lookups and what I wanted to do is for the user to choose a Department, then the subsequent dropdown is filtered to only those employees within that department.
In the Manage Lookup field, in the Employee name option I have added the following in the Request Items:
function (term, page) {
// Getting the selected Department
var DeptId = fd.field('Department').value();
if (!DeptId) {
DeptId = 0;
}
// Filtering by the selected Department
if (!term || term.length == 0) {
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField},Department/Id&$orderby=Created desc&$expand=Department/Id&$filter=Department/Id eq " + DeptId + "&$top=10";
}
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField},Department/Id&$orderby={LookupField}&$expand=Department/Id&$filter=startswith({LookupField}, '" + term + "') and Department/Id eq " + DeptId + "&$top=10";
}
I think this is correct as I have used information in the documentation - changing the appropriate fields. However, after changing the Department field I get an Error:
some error messages:
LoadListContextData @ clienttemplates.js?rev=ANYVkLsKaQttIxUm0vIobw%3D%3DTAG0:1
/_layouts/15/plumsail/crosssitelookup/select2/select2_locale_en.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
/_layouts/15/plumsail/crosssitelookup/select2/select2_locale_en-US.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
fd_Item_New.aspx?List=b48f6a49-a244-49c7-976a-ef92a55d66c7&Source=http%3A%2F%2Fhf-sp%2Fsites%2FPersonnel%2Fabsence%2FLists%2FReport_Absence%2FAllItems.aspx&RootFolder=&Web=113eb9d5-cbb8-4b6c-8910-b2579e22f958:1 Refused to execute script from 'http://hf-sp/_layouts/15/plumsail/cross ... cale_en.js' because its MIME type ('') is not executable, and strict MIME type checking is enabled.
fd_Item_New.aspx?List=b48f6a49-a244-49c7-976a-ef92a55d66c7&Source=http%3A%2F%2Fhf-sp%2Fsites%2FPersonnel%2Fabsence%2FLists%2FReport_Absence%2FAllItems.aspx&RootFolder=&Web=113eb9d5-cbb8-4b6c-8910-b2579e22f958:1 Refused to execute script from 'http://hf-sp/_layouts/15/plumsail/cross ... e_en-US.js' because its MIME type ('') is not executable, and strict MIME type checking is enabled.
/sites/Personnel/_api/web/lists('e51429f6-57b4-413b-a896-6e224ae08ec0')/items?$select=Id,Employee_x0020_Name,Department/Id&$orderby=Created%20desc&$expand=Department/Id&$filter=Department/Id%20eq%2013$top=10&_=1539266415746:1 Failed to load resource: the server responded with a status of 400 (Bad Request)
I've read through the article on Filter Cross site lookups and I think I have everything correct. However I can't see what I'm doing wrong.
I have a List in a site called personnel
in that list I have Employee Name and Department.
In a Subsite I have a list that contain cross site look ups for both these field (in the sub site the columns have the same name)
In my form designer I have these two CS Lookups and what I wanted to do is for the user to choose a Department, then the subsequent dropdown is filtered to only those employees within that department.
In the Manage Lookup field, in the Employee name option I have added the following in the Request Items:
function (term, page) {
// Getting the selected Department
var DeptId = fd.field('Department').value();
if (!DeptId) {
DeptId = 0;
}
// Filtering by the selected Department
if (!term || term.length == 0) {
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField},Department/Id&$orderby=Created desc&$expand=Department/Id&$filter=Department/Id eq " + DeptId + "&$top=10";
}
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField},Department/Id&$orderby={LookupField}&$expand=Department/Id&$filter=startswith({LookupField}, '" + term + "') and Department/Id eq " + DeptId + "&$top=10";
}
I think this is correct as I have used information in the documentation - changing the appropriate fields. However, after changing the Department field I get an Error:
some error messages:
LoadListContextData @ clienttemplates.js?rev=ANYVkLsKaQttIxUm0vIobw%3D%3DTAG0:1
/_layouts/15/plumsail/crosssitelookup/select2/select2_locale_en.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
/_layouts/15/plumsail/crosssitelookup/select2/select2_locale_en-US.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
fd_Item_New.aspx?List=b48f6a49-a244-49c7-976a-ef92a55d66c7&Source=http%3A%2F%2Fhf-sp%2Fsites%2FPersonnel%2Fabsence%2FLists%2FReport_Absence%2FAllItems.aspx&RootFolder=&Web=113eb9d5-cbb8-4b6c-8910-b2579e22f958:1 Refused to execute script from 'http://hf-sp/_layouts/15/plumsail/cross ... cale_en.js' because its MIME type ('') is not executable, and strict MIME type checking is enabled.
fd_Item_New.aspx?List=b48f6a49-a244-49c7-976a-ef92a55d66c7&Source=http%3A%2F%2Fhf-sp%2Fsites%2FPersonnel%2Fabsence%2FLists%2FReport_Absence%2FAllItems.aspx&RootFolder=&Web=113eb9d5-cbb8-4b6c-8910-b2579e22f958:1 Refused to execute script from 'http://hf-sp/_layouts/15/plumsail/cross ... e_en-US.js' because its MIME type ('') is not executable, and strict MIME type checking is enabled.
/sites/Personnel/_api/web/lists('e51429f6-57b4-413b-a896-6e224ae08ec0')/items?$select=Id,Employee_x0020_Name,Department/Id&$orderby=Created%20desc&$expand=Department/Id&$filter=Department/Id%20eq%2013$top=10&_=1539266415746:1 Failed to load resource: the server responded with a status of 400 (Bad Request)
-
- Information
-
Who is online
Users browsing this forum: No registered users and 10 guests