Employee Center Autocomplete Suggestions is not working in XanaduDescriptionBuild information:<Builds that are known to be affected (e.g. June 2011 Preview 2)> glide-xanadu-07-02-2024__patch1-08-24-2024<Builds that are known NOT to be affected (e.g. Calgary Patch 2, Hot fix 5)> lide-washingtondc-12-20-2023__patch5-06-21-2024Issue Description:The Autocomplete Suggestions of OOB ESC AI Search is not working in Xanadu In the same Xanadu instance, there is no such issue in SP portal. Issue happens only on ESC portal (See attached)With the same EC version (34.0.7), no such issue is found in Washington DC instance (See attached)Verified that the KB article is connected to the OOB TaxonomySteps to Reproduce 1. Open OOB ESC portal in Xanadu2. In the Search box, type "What is spam?"Expected behaviorThere are suggestions in the Typeahead widgetActual behaviorNo suggestions resultsWorkaroundThis is happening because we shipped a new home page in EC with id ec_home. This new home page has a new widget instance of Homepage Search widget which is of type sp_instance → sys_id: 199aecc4c7a83110b1c6677703c26078. Homepage search embeds Typeahead search widget, which takes in some instance options to enable disable suggestions, autocomplete, etc. Those instance options are available through widget instance itself. But these options are not available in sp_instance but present in sp_instance_ais . The other Homepage Search instances are already sp_instance_ais but not this one 199aecc4c7a83110b1c6677703c26078. The following script can be run from System definition → Scripts - Background, through global scope. This script will convert sp_instance to sp_instance_ais and fix the issue. gs.info("Loading fix script fix_esc_ais_instances"); if (pm.isActive("com.sn_hr_service_portal")) { reclassifySearchInstances(); } function reclassifySearchInstances() { var searchInstances = ""; searchInstances += "0089509c732023009512e1e54cf6a7d3,"; searchInstances += "3de232209f22120047a2d126c42e70b1,"; searchInstances += "8481f0b4539132003066664906dc34da,"; // Instances when com.sn_hr_madrid_deprecated_sp plugin is installed searchInstances += "3e4430070b7303008cd6e7ae37673a12,"; searchInstances += "73a7c04c530132002b76da86a11c0876,"; // Instances when com.sn_hr_deprecated_sp plugin is installed searchInstances += "5ded888c530132002b76da86a11c0853,"; searchInstances += "47a7ce0093b0320092051d1e867ffb12,"; // Instances when com.sn_hr_core plugin is installed searchInstances += "7cc614e5c3513200b599b4ad81d3aea7,"; searchInstances += "1f941d09533022003585c3c606dc3414,"; searchInstances += "44081f729f3022009205f7f8677fcfd7,"; searchInstances += "199aecc4c7a83110b1c6677703c26078"; var oobInstances = []; try { var gr = new GlideRecord('sp_instance'); if (!gr.isValid()) return; gr.addQuery('sys_class_name', 'sp_instance'); gr.addQuery('sys_id', 'IN', searchInstances); gr.query(); while (gr.next()) { var id = gr.getUniqueValue(); var packageId = gr.sys_package; var isCustom = isCustomized(id); if (!isCustom) oobInstances.push(id); gr.setValue('sys_class_name', 'sp_instance_ais'); gr.autoSysFields(false); gr.setWorkflow(false); gr.update(); gr.setValue('sys_package', packageId); gr.update(); gs.info('Reclassified sp_instance ' + gr.getUniqueValue() + ' to sp_instance_ais'); } // Delete sys_update_xml and sys_update_version records which created during reclassification. deleteUpdatesForCustomInstances('sys_update_xml', oobInstances); deleteUpdatesForCustomInstances('sys_update_version', oobInstances); } catch (err) { gs.info('Reclassification of Search widgets instances failed with error - ' + err.name + '::' + err.message); } } function deleteUpdatesForCustomInstances(updateTable, oobInstances) { try { var gr = new GlideRecord(updateTable); gr.addQuery('name', 'IN', getQuery(oobInstances)); gr.setWorkflow(false); gr.query(); gr.deleteMultiple(); } catch (err) { gs.info('Delete of customized entry failed with error - ' + err.name + '::' + err.message); } } function getQuery(oobInstances) { var newArray = oobInstances.map(function (el) { return 'sp_instance_ais_' + el; }); return newArray.toString(); } // Check if the instance is customized function isCustomized(recId) { var isCustomized = false; try { var gr = new GlideRecord('sys_update_xml'); gr.addEncodedQuery('name=sp_instance_' + recId); gr.setLimit(1); gr.setWorkflow(false); gr.query(); isCustomized = gr.next(); } catch (err) { isCustomized = true; } return isCustomized; }Related Problem: PRB1806589