UPDATE TABLE

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
geppoleppo
Posts: 7
Joined: 2015-03-25 13:10

UPDATE TABLE

Post by geppoleppo » 2018-04-11 13:55

Hi, I ask you for help.
In a table I added a new field (FIELD 3) in which I write the calculation of two other fields (FIELD 1 and FIELD 2).
How can I update the whole table?

FIELD1 | FIELD2 | FIELD 3 (FIELD 1+FIELD2)|
3 | 10 | 13 |
4 | 5 | NULL() |
6 | 4 | NULL() |
......

Thanks
Silvano

R Tammam
Veteran Member
Posts: 113
Joined: 2017-08-26 15:35

Re: UPDATE TABLE

Post by R Tammam » 2018-04-12 09:49

Hello geppoleppo,
you can do it easily, just open the project folder
go to hooks file , then table name and put the following line in before inset and before update function , and it will sum them automatically
and if you want to get this calculation only on updating Field1 and Field2 , just add it in before update function

Code: Select all

$data['FIELD3'] = $data['FIELD1'] + $data['FIELD 2'];

Post Reply