Resolving the scenario

Mark can implement the requirements by using the following script enhancements, introduced in Microsoft Dynamics CRM 2016:

                    Xrm.Page.getControl(field name).addOnKeyPress(
name of function);
                    Xrm.Page.getControl(arg).removeOnKeyPress(
function name);
                    Xrm.Page.getControl(field name).fireOnKeyPress();
                    Xrm.Page.getControl(field name)
.showAutoComplete(object);

The object parameter in the preceding syntax is an array of possible handlers, as follows:

                    var resultset = {
results: [{
id: <value1>,
icon: <url>,
fields: [<fieldValue1>]}],
commands:{
id: <value>,
icon: <url>,
label: <value>,
action: <function reference>
}
}
                    Xrm.Page.getControl(field name). 
hideAutoComplete ();