Q: AutoComplete resulting "undefined" I'm using auto complete for name field, but when I tried change the field to custom field them returned "undefined".
When I use the name field, return the correct record.
public static List<CustomObject> searchMovie(String searchTerm) {
    Map<String, CustomObject> mapAccount = new Map<String, CustomObject>();
    List<CustomObject> registros = Database.query('Select banco__c from CustomObject where banco__c like \'%' + String.escapeSingleQuotes(searchTerm) + '%\'');
    registros.sort();
    for(CustomObject acc : registros){
        mapAccount.put(acc.banco__c, acc);
    }
    registros = new List<CustomObject>();
    update mapAccount.values();
    registros.addAll(mapAccount.values());      

    return registros;
}

My Script:
<script type="text/javascript">
var movieObjects;
var queryTerm;
$('[id$=movieTextBox]').autocomplete({
    minLength: 2,
    source: function(request, response) {
        queryTerm = request.term;
        teste.searchRecord(request.term, function(result, event){
            if(event.type == 'exception') {
                alert(event.message);
            } else {
                movieObjects = result;
                response(movieObjects);
            }
        });
    },
    focus: function( event, ui ) {
        $('[id$=movieTextBox]').val( ui.item.Name );
        return false;
    },
    select: function( event, ui ) {
        $('[id$=movieTextBox]').val( ui.item.Name );
        $('[id$=searchMovieId]').val( ui.item.Id );
        return false;
    },
})
.data( "autocomplete" )._renderItem = function( ul, item ) {
    var entry = "<a>" + item.Name;

    entry = entry + "</a>";
    entry = entry.replace(queryTerm, "<b>" + queryTerm + "</b>");
    return $( "<li></li>" )
    .data( "item.autocomplete", item )
    .append( entry )
    .appendTo( ul );
};
</script>


A: You also need to update the FieldName instead Of Name in every place where you are referring Name and your problem will be solved.
