Cascaded lookup
Posted: 11 Jun 2018
hi im having difficulty configureing my cascaded look up, the look up just has a spinning circle now.
please see the code I have used
function (term, page) {
// Getting the selected Company
var companyId = fd.field('Company0').value();
if (!companyId) {
companyId = 0;
}
// Filtering by the selected company
if (!term || term.length == 0) {
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField},Company0/Id&$orderby=Created desc&$expand=Company0/Id&$filter=Company0/Id eq " + companyId + $top=10";
}
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField},Company0/Id&$orderby={LookupField}&$expand=Company0/Id&$filter=startswith({LookupField}, '" + encodeURIComponent(term) +"') and Company/Id eq " + companyId + "&$top=10";
}
any help would be gratefully received
please see the code I have used
function (term, page) {
// Getting the selected Company
var companyId = fd.field('Company0').value();
if (!companyId) {
companyId = 0;
}
// Filtering by the selected company
if (!term || term.length == 0) {
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField},Company0/Id&$orderby=Created desc&$expand=Company0/Id&$filter=Company0/Id eq " + companyId + $top=10";
}
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField},Company0/Id&$orderby={LookupField}&$expand=Company0/Id&$filter=startswith({LookupField}, '" + encodeURIComponent(term) +"') and Company/Id eq " + companyId + "&$top=10";
}
any help would be gratefully received