Hello,
I have implemented Cascading Lookups and it is working well.
In some instances, there is only one result when the dependent Lookup is filtered and the customer would like it if that single item was automatically selected for the user.
I've tried both of the following methods (commented out currently) and neither of them work:
function filterChildren(parent) {
var parentId = parent && parent.LookupId || parent || null;
fd.field('childLookup').filter = 'ParentLookup/Id eq ' + parentId;
fd.field('childLookup').widget.dataSource.read();
if(fd.field('childLookup').widget.dataSource.data().length == 1){
// fd.field('childLookup').value = fd.field('childLookup').widget.dataSource.data()[0];
// fd.field('childLookup').widget.selectedIndex = 1;
}
}
Is there a way make this work?