CRM-13966 - Refactor autocomplete custom field