This topic is locked

Change the field of another tab

1/4/2012 12:04:05 PM
PHPRunner General questions
W
wundebar author

Hi at all!

I have to differents tables "clienti" and "corsi".

With an inner join i have inserted into "corsi" the field "formazione" who is an originally field of clienti ( as always it give me error "unknown colum clienti.formazione in field list" that i bypassed selecting in "edit as" the readonly option ).

Anyway i would like change the value inside "formazione" with "BASSO" when i choose two of four differents options by a drop down box of another field named "cat_dipendenti".

I used this old code, in the page event "after record processed" for testing the possibility of change two differents field of two differents tables without the option of autofill.

if ($data["cat_dipendenti"]=="Impiegata")

{

$record["formazione_style"]='style="font-weight:bold;color:white;background:red"';

}


And it works.

I would like to know if exist or phprunner give the possibility to do the same thing changing the value not just the background color, so that i can see "BASSO" instead of a red background.

Thanks for help!

Best Regards.

C
cgphp 1/4/2012

In the "List page: Before record processed" event enter this code:

if($data['cat_dipendenti'] == 'Impiegata')

{

$data['formazione'] = 'BASSO';

}
W
wundebar author 1/9/2012



In the "List page: Before record processed" event enter this code:

if($data['cat_dipendenti'] == 'Impiegata')

{

$data['formazione'] = 'BASSO';

}




Hi Cristian, thanks for reply. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=63514&image=1&table=forumreplies' class='bbc_emoticon' alt=':rolleyes:' />

I've tried this code in "before record processed" but it not works! <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=63514&image=2&table=forumreplies' class='bbc_emoticon' alt=':(' />

Here there are some screen shot of my database with the fields that i would like to change.

I hope it is understandable <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=63514&image=3&table=forumreplies' class='bbc_emoticon' alt=':unsure:' />



thanks for help!

C
cgphp 1/9/2012

If cat_dipendenti is a lookup, the code becomes:

if($data['cat_dipendenti'] == N)

{

$data['formazione'] = 'BASSO';

}

return true;


where N is the value of the link field for cat_dipendenti. Look at the table of the cat_dipendenti lookup and check what is the value of the link field (the primery ID field generally) for the "Impiegata" record.