Cross Site Lookup Cascade
Posted: 02 Apr 2014
I have 2 cross site lookups, 1 is the company info and the second is the realted contacts. Here is my code, not sure what I'm doing wrong but I am very new to this.
function (term, page) {
// Getting the selected country
var relationId = fd.field('Relation').control().value();
if (!relationId) {
relationId = 0;
}
// Filtering by the selected country
if (!term || term.length == 0) {
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField},Title/Id&$orderby=Created desc&$expand=Title/Id&$filter=Title/Id eq " + relationId + "&$top=10";
}
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField},Title/Id&$orderby={LookupField}&$expand=Title/Id&$filter=startswith({LookupField}, '" + term + "') and Title/Id eq " + relationId + "&$top=10";
}
Thank you again.
function (term, page) {
// Getting the selected country
var relationId = fd.field('Relation').control().value();
if (!relationId) {
relationId = 0;
}
// Filtering by the selected country
if (!term || term.length == 0) {
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField},Title/Id&$orderby=Created desc&$expand=Title/Id&$filter=Title/Id eq " + relationId + "&$top=10";
}
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField},Title/Id&$orderby={LookupField}&$expand=Title/Id&$filter=startswith({LookupField}, '" + term + "') and Title/Id eq " + relationId + "&$top=10";
}
Thank you again.