Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Update Other Fields and Autocomplete

Locked
fat115
Posts: 11
Joined: Sun May 11, 2014 9:18 am
Location: France

Update Other Fields and Autocomplete

Unread post 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.
You do not have the required permissions to view the files attached to this post.
fat115
Posts: 11
Joined: Sun May 11, 2014 9:18 am
Location: France

Re: Update Other Fields and Autocomplete

Unread post 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 :?
admin
Site Admin
Posts: 2815
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Update Other Fields and Autocomplete

Unread post by admin »

.
Locked