I am usimg lookup field and I populate it according to a rule once it populated (for example) with account entity and other time it populate with contact entity, I get the results I need but, if I got 10 results from account and then I changed to contact and got one result I'll see 10 records (9 empty but still shown at the lookup field ans one of the 10 is the result I need) , how to remove these gaps from lookup field using JS?
**more info : the function that populate the lookup is fired from onchange event
I tried to reset the lookup field before I repopulate it but it stays the same:
Xrm.Page.getAttribute("my_lookup_field").setValue(null);
Xrm.Page.getControl("my_lookup_field").getAttribute().setValue(null);
I tried to use :
Xrm.Page.getControl("my_lookup_field").clearOptions(); - got an exception
*This post is locked for comments