Autocomplete / SQS search stopped working on Relate field

I believe this one falls under the category of “huh?” and I have been trying to diagnose but with no luck.

Does anyone know why a Relate field would NOT use the sqs search / autocomplete?
And how I could reconfigure it so it DOES use the sqs search / autocomplete?

I have a custom module AYU_Funds and in the EditView of that module I have 2 relate fields created with Studio as a result of creating One-to-Many relationships from Events to AYU_Funds and from Products to AYU_Funds.

The Events relate field does NOT autocomplete or present options for selection when you type into the field. The Select button works fine.

The Products relate field DOES autocomplete and present options for selection when you type into the field. The Select button also works fine.

If I add a second Events relate field, it DOES autocomplete and present options for selection when you type into the field. The Select button also works fine.

So I assume something went wrong with the creation/…? of the first Events relate field that was created using the same process as the second one : Create a One-to-Many field in Events pointing to AYU_Funds

There is a difference in the css for the first and second Events Relate field, but I do not know why. When I inspect the two fields - and compare to the other relate field, I can see that the YUI elements are missing from the css of the relate field that does not use sqs/autocomplete

The <input …> for the first (non-working) Events relate field is

<input type="text" name="fp_events_ayu_funds_1_name" class="sqsEnabled" tabindex="0" id="fp_events_ayu_funds_1_name" size="" value="" title="" autocomplete="off">

The <input …> for the second (working) Events relate field - and the Products relate field - is

<input type="text" name="fp_events_ayu_funds_2_name" class="sqsEnabled yui-ac-input" tabindex="0" id="fp_events_ayu_funds_2_name" size="" value="" title="" autocomplete="off">

The only difference I see is the “yui-ac-input” in the working code.

I do not know what happened to have the yui-ac-input not present in the first Events relate field and I do not even know if in fact that is the problem, but it is the only difference I can find so …

Is there a way I can add the yui-ac-input back into the first Events relate fields?

I can not just delete it since the system has been ppopulated (11,000+ Contacts, 800+ Accounts) and there are over 6,000 entries in the AYU_Funds module which would no longer have entries in the Events subpanel if I deleted and re-created the Events relate field in AYU_Funds. … Unless someone knows how to substitute one Relate field (as part of a one-to-many relationship) for another AND keep the data that was part of the original relationship.

Ideas?

It really does get embarassing having to publicly admit being an idiot.

Problem solved.

In the vardfef file where I defined the populate_list and field_list, I defined the arrays with a non-sequential key. I had deleted one of the entries and not renumbered the keys. So my vardef file looked like (Now corrected and all working well)

$dictionary['AYU_Funds']['fields']['fp_events_ayu_funds_1_name']['populate_list'] = array(
    0 => 'name',
    1 => 'id',
    3 => 'default_date_paid',
);
$dictionary['AYU_Funds']['fields']['fp_events_ayu_funds_1_name']['field_list'] = array(
    0 => 'fp_events_ayu_funds_1_name',
    1 => 'fp_events_ayu_funds_1fp_events_ida',
    3 => 'effective_date_paid',
);