Ajax with API problem

Lookup_Selecting server event is server side, that means the filter is already set when the page is loaded, normally you don’t change it, not by Ajax either. If you want to filter dynamically, you should use JavaScript on the client, you may use the “addoption” event, e.g.

$(document).on("addoption", function(e, args) {
  if (args.name == "x_MyField") { // Check field name
    var data = args.data;
    // Check the data of option to be added, if you want to filter it out, set args.valid to false;
    if (<data is invalid>) args.valid = false;
  }
});