Cascading Drop-Down Without Forms Designer

Discussions about Cross-site Lookup
Locked
kkreitzer
Posts: 2
Joined: Thu May 04, 2017

04 May 2017

Hello,

We have a standard SharePoint EditForm.aspx that we need to have a cascading drop down on. The "Dependents" field should only show items that are related to the field "Employee". I am not familiar enough with JS to figure this out. Below is what I have so far, but I am receiving error messages in the developer console.

function (term, page) {

//Get LookupField value
var employeeValue = new item.get_item('Employee');
var emplID = employeeValue.get_lookupId();

if (!term || term.length == 0) {
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField}&$orderby=Created desc&$top=10&$filter=Employee/ID eq '" + emplID + "'";
}
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField}&$orderby={LookupField}&$filter=startswith({LookupField}, '" + encodeURIComponent(term) + "')&$top=10&$filter=Employee/ID eq '" + emplID + "'";
}

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 11 guests