[SOLVED] - How to have a field that automaticaly checks changes on another field and update itself ?

nusilmar

Member
How to have a field that automaticaly checks changes on another field and update itself ?

I have a table1 with this setting :
id, date, software type (DBJ to a software type table), software ( CCD to a software table watching software type), version ( this is all the versions released of a software)
On this table i can have several software versions for several softwares but only one version is the current version, per software)

And a table 2 with this setting:

customer ( DBJ to customer table), software type (DBJ to a software type table), software ( CCD to a software table watching software type), version ( CCD to versions table watching software) , iscurrent ( yes/no field)

My main goal is to have the field iscurrent on table 2 to be automaticaly updated every time a certain software gets a new version, so that it shows on that field if the customer have the latest version.
 
ARRGGGGG !!!!

Autofill is my downfall !!!!

have this setting ( check image) but still no autofill.

My setting is :

Main table where i store all software types and all versions of a particular software. table setting is : ( id, brand, software type, software version, isupdated? )

Secondary table is the one that as to be updated by autofill. table setting is : ( id, client, brand, software type, software version, isupdated ( THIS ONE AS TO BE UPDATED))

So i want to check software version on secondary table to see if it's an updated version or not, so it as to go check that version on main table and get those version isupdated field value and put it on secondary table isupdated field.

To help you guys on your quest to help me ( hopefully, eheheh) translation is as follows :

LIST : Vers?es : this points to main table, on db is fab_versoes
Lookup field : Vers?o : this points to main table field "software version"
Field to Observe : Vers?o : this points to secondary table field "software version"
Map : {"fab_versoes__Versao_actualizada":"form_plugin_autofill__Actualizada"}
This mapping gets from main table the field "isupdated" value and puts in the form element "isupdated" of secondary table

Not using any trigger and field is updated on edit and on new

Any help ???
errorautofill.jpg
 
You have a [ instead of { in your map data area in the image.


Yes, i know, i also noticed that and fixit, but still nothing. I can see that there is an search/update working ( ajax working) but no data is found. Have already changed fab_versoes lookup field to ID but still nothing ....

Haven't quit yet, stubborn guy here...
 
Alright, guys, i've taken another direction :

Going to use Schedule way, running a php script with the update query. After some though i realize that it is the only option, because using autofill would only update the record i went to and in form view, meaning that if i saw the data in list view it would be wrong ( if i haven't enter in those records form view).

So what i did ( as if helps others in the same situation) is to create an schedule with a php plugin using this script :
Code:
// Get the db object
$db = JFactory::getDbo();
 
// Build the query ? Tables names = CASE SENSITIVE
$query = $db->getQuery(true);
 
$query
      -> update('fab_versaoinstalada AS a')
      -> join('LEFT','fab_versoes AS b ON a.Versao=b.id')
      -> set('a.Actualizada = b.Versao_actualizada');
   
$db->setQuery($query);
 
// Run the query
$found = (int) $db->execute();

Problems found : Only one : it doesn't run as cron job, only runs manualy ( not in the 5 minute period i've setted) . Do you have a solution or should i get my menu entry with &fabrik_cron=1 instead ??
 
Success !!!

Finally was able to put schedule to work ( my bad, was trying to make it work in backoffice but forgot to view a list or form in frontoffice

On a side note i also was able to make form autofill plugin to work
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top