From d149e7fa1bf0561b9dfff922651119efa2a0987b Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Sun, 13 Nov 2022 21:29:25 -0500 Subject: [PATCH] APIv4 Explorer - Use APIv4 autocomplete instead of v3 entityRef --- ang/api4Explorer/Explorer.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ang/api4Explorer/Explorer.js b/ang/api4Explorer/Explorer.js index d158121097..817e7103c2 100644 --- a/ang/api4Explorer/Explorer.js +++ b/ang/api4Explorer/Explorer.js @@ -1259,8 +1259,11 @@ $el.removeClass('loading').crmSelect2({data: options, multiple: multi}); }); } else if (field.fk_entity) { - var apiParams = field.id_field ? {id_field: field.id_field} : {}; - $el.crmEntityRef({entity: field.fk_entity, api: apiParams, select: {multiple: multi}, static: field.fk_entity === 'Contact' ? ['user_contact_id'] : []}); + $el.crmAutocomplete(field.fk_entity, {fieldName: field.entity + '.' + field.name, key: field.id_field || null}, { + multiple: multi, + static: field.fk_entity === 'Contact' ? ['user_contact_id'] : [], + minimumInputLength: field.fk_entity === 'Contact' ? 1 : 0 + }); } else if (dataType === 'Boolean') { $el.attr('placeholder', ts('- select -')).crmSelect2({allowClear: false, multiple: multi, placeholder: ts('- select -'), data: [ {id: 'true', text: ts('Yes')}, -- 2.25.1