These methods enable you to perform data validations in a control even before the user commits (saves) the value in a form.Use this to add a function as an event handler for the keypress event so that the function is called when you type a character in the specific text or number field.The get Value method is different from the attribute get Value method because the control method retrieves the value from the control as the user is typing in the control as opposed to the attribute get Value method that retrieves the value after the user commits (saves) the field.Use add On Key Press, remove On Key Press, and fire On Key Press methods to provide immediate feedback or take actions as user types in a control.Control the results displayed for a user to choose from when they set the value of a lookup control using the add Custom Filter, add Custom View, get Default View, set Default View methods.You can add or remove event handlers for the Pre Search event using the add Pre Search and remove Pre Search methods.
The function will be added to the bottom of the event handler pipeline.The control object provides methods to change the presentation or behavior of a control and identify the corresponding attribute. For controls that are bound to attributes it is common to access controls through the Xrm. The custom controls for Dynamics 365 mobile clients (phones and tablets) supports all the control properties and methods except the following: Auto-completion methods, get Value, Keypress methods and Lookup control methods and events.You access controls using the following collections: Xrm. With Microsoft Dynamics CRM Online 2016 Update 1 and Microsoft Dynamics CRM 2016 Service Pack 1 (on-premises) release, the following methods are now supported for the timer control on the new form rendering engine (also called "turbo forms"): get Control Type, get Name, get Parent, Label methods, refresh, and Visible methods.For a sample Java Script code that demonstrates the auto-completion feature, see Sample: Auto-complete in Dynamics 365 controls Use this to show up to 10 matching strings in a drop-down list as users press keys to type character in a specific text field.You can also add a custom command with an icon at the bottom of the drop-down list.However, the attribute is not part of the attribute collection for the entity.While you can retrieve the value for that attribute using get Value and even change the value using set Value, changes you make will not be saved with the entity.The execution context is automatically set to be passed as the first parameter passed to event handler set using this method.More information: Execution context (client-side reference)You should use reference to a named function rather than an anonymous function if you may later want to remove the event handler for the field.This method can only be used in a function in an event handler for the Lookup Control Pre Search event.The following code sample is for the Opportunity form Account (parentaccountid) lookup.