Autocomplete and edit record

Autocomplete and edit record

Can anyone help point me in the right direction with an issue i'm having with using an autocomplete field in an edit record?

I have a field in a form that correctly lets a user (from a user entity) be selected when a new record is being added.  The autocomplete record list is populated from an advanced query and fed into the appropriate output structure that has a label and identifer attributes.  It's an advanced query because the Label needs to be a concatenation of the User group and the username....the identifier is the User Identifier.

This all works fine for a new record, what I cant seem to get working is the edit record section unless the user field is selected and the appropriate value is selected from the autocomplete list.  In other words, when editing a record that doesnt involve a change to the field that has the autocomplete on it that field is invalid.

I believe it's probably because the auto complete list is only populated when interacted with so I assume I need to add something to the preperation here to ensure that if we are editing a record (instead of creating a new one) the correct entry (label and ID) is pre-selected both with the correct label displayed as well as the underlying ID...i'm just not sure how to go about that so any advice would be appreciated. 
I got this solved by using another field for the actual data and converting the existing autocomplete box to be used only to search and select the record needed.
Hi John,
In case of Autocomplete you have to set the actual data which you wants to display in autocomplete box and you will get its it from "InputAutocompleteGetIdentifier" .

Hi Pramod,

The data was set, but in the case of editing an existing record, where there was no further interaction with the autocomplete box and only other fields in the record were "touched", the autocomplete record list was never populated as the event that populated was never triggered.  As such although the data was present in the field, there was no associated identifier because the record list tied to the field is only populated once there is some interaction with the field...which doesnt always happen when editing.

It's all fixed now though as i'm using the autocomplete only to search and not actually store the entry i need as part of the record.  I setup an action that fires when the user selects something from autocomplete that populates these fields and ajax refreshes the edit record container.

Thanks again
Hi John. I think you were meant to use the PreviousIdentifier in the Input_AutoComplete_GetIdentifier action. Passing to it the value of your existing id would solve your use case.

Having said that, you may want to have a look into an alternative autocomplete component that I am developing. It's already available in the forge, but there's a new release in the makings that I'm going to publish in a few days!