I am having no luck filtering a Lookup column. I have tried a number of different examples in the community with no luck returning results in some instances or the correct results in others.
I am looking up Contacts. I want to filter by a Company Name. The Company Name is a Single Line Text Column. The Company Name will be static because I just want to include contacts from my Company. The Contact Field I am looking up is also a Single Line Text Column.
I have included the Extra Field CLCompanyCopy in Forms, this is the internal name of the column I want to apply the filter on.
Here is the code I am using, which is returning results just not filtered result.
function filterSiteContact(){
var v = 'MyCompany';
fd.field('Site_x0020_Contact').filter = "CLCompanyCopy eq '" + v + "'";
//alert(fd.field('Site_x0020_Contact').filter);
fd.field('Site_x0020_Contact').widget.dataSource.read();
}
fd.field('Site_x0020_Contact').ready().then(filterSiteContact);
I have also tried this without the fd.field('Site_x0020_Contact').ready().then(filterSiteContact); and no function. This yields no results. I have verified the String matches what I am trying to filter.
My eventual goal is to filter by both company name and a status (which is a choice field), then also ordering the results by the last name column but since I cannot get this easy filter to work I am trying to simplify and work my way up!