Page 1 of 1

Update Other Fields and Autocomplete

Posted: Sat May 17, 2014 6:12 pm
by fat115
Hi,

I'm trying to update a field on a form depending on the value selected in a lookup.
I've put a PHP function in the Lookup Tab and call this function to update an object in the "Update Other fields" Subform.
UpdateLookup.png
Using the lookup form via the button, it works :
UpdateLookup.png
My field named "Référent" is updated.

But using the autocomplete, nothing appears :
UsingAutocomplete.png
Is there something more to do or is this a bug ?

Thanks for your answers.

Re: Update Other Fields and Autocomplete

Posted: Sun May 18, 2014 5:56 pm
by fat115
Solved !

The Lookup Form does a lookup with the id, in my case 'ele_id' so the WHERE condition "WHERE ele_id = '#RECORD_ID#'" returns a value.
But the autocomplete feature is using code for the lookup so you need to add a condition to the WHERE clause.
In my case, replacing "WHERE ele_id = '#RECORD_ID#'" by "WHERE ele_id = '#RECORD_ID#' OR CONCAT_WS(' ',ele_nom,ele_prenom) = '#RECORD_ID#'" make it works !

Not very intuitive :?

Re: Update Other Fields and Autocomplete

Posted: Wed Jun 04, 2014 6:00 am
by admin
.