Description
When adding a field to a form, Dynamics 365 offers some out-of-the-box controls. Depending on the field type, the control improves the user experience by changing how to interact with the field. Each control is dedicated to a single feature.
One of these features is the “Auto-Complete” control. Available for single lines of text fields, these controls let the user choose the field value based on a data set.
There are two types of data sets available: View or Option Set:
- View
- This option requires the data to be stored in an entity through records.
- Option Set
- The data is directly in the option set values.
Once configured, the user will see a drop-down list with the values from the data sets available. Users can then simply choose the desired value that will be added to the field. If a user starts typing some text on the field, the list will get filter accordingly.
Note that the control will not allow the user to add a value that is not part of the view/option set.
Example of usage
This feature can be used to improve the data quality of addresses fields. For example, it can be used to display a list of all countries or Switzerland’s cantons.
Always in the address management scenario, it can be combined with some JavaScript code to fill multiple fields at once (town, zip code, canton and country).
Take-away points
- Out-of-the-box
- Easy to configure and maintain
- Improves data quality
Comments
Not throwing the onChange event
I am using the autocomplete control (cc_autocomplete_name) which I believe is written by Microsoft. It was already part of the CRM implementation. I use the autocomplete for Country in the Contact form. When the Country field is changed, I need to execute some JavaScript. I have put the control on the form and set the onChange event to call my code. When I run tests, the onChange event is not called by this control. Have you experienced this? Is there somewhere else I need to set the onChange event?