Update display of DB value

To make it simple : Let’s say I have 3 fields on a form. All are database fields.
If user entered a number in field 1 and another number in field 2, and saving, I want to display the sum in the 3rd field (read only).
When I enter the numbers and save the record, the 3rd total field doesn’t update on the screen. It updates in the db via a trigger.
on mysql database.
So I guess when you save a record,
it doesn’t reload the values from the database? I know I can do it with Ajax onupdate event, but I’d prefer not to, since
in realty, there are about 200 fields that I would have to create the event… Is there someway to easily get the 3rd total
field to update?

When this didn’t work as I expected, I was surprised. Now, I’ve discovered on this form that ajax is not working either. I have a dropdown next to field1 where the user can select to ‘allow’
10%, 20%, etc. of the value entered in field 1. That allowed value displays in field 2. This has worked for months…until now. Something strange in an SC update maybe?
This is in addition to the problem I described in my original message
field1 : 1,0000 pct allowed : 10% (ajax does the calc) and displays) field2 : 100 (this no longer works)
etc
etc
etc
field1 total (this doesn’t work)

FYI : the ajax processing seems to take place. I get the ajax animation that says “processing” and I echo the numbers and they are correct, but the display on the screen doesn’t update.

Can you paste your script, so i can help you. The event ajax must work fine or you can do it with a trigger too.

Thanks so much for you offer to help. I played around with the coding in the Ajax event and that is working now. I have Ajax events on about 75 different fields onchange and they all stopped working. Each event is about 500 lines so below I have just copied the last few lines. I had to comment out the part at the bottom where I marked it “Commented Out”. When I comment it out, it works. Uncommented, it doesn’t. Those fields at the bottom, {total_curr_assets_allowed}, etc. originally were not DB fields. I decided to make them DB fields and use a trigger on the DB instead of doing the summing in the php. So, I still have my trouble with the Totals not displaying, but I have to fix the 75 Ajax events first…thanks again.

elseif
({misc_fa4_name} == ‘’)
{
{misc_fa4_name} = ‘Investments in and advances to construction joint ventures’ ;
{misc_fa4_allowed} = {ca_investments_jvs}{throwmult};
{misc_fa4_comment} = ‘Thrown from current’ ;
}
else
{
echo “error 100 with ‘{misc_fa4_name}’” ;
}
}
/
*** END OF THROW 100 ****/

else
{

}

if ({ca_investments_jvs_pct_allowed} <> ‘dollar’)
{
{ca_investments_jvs_allowed} = {ca_investments_jvs}*{mult};
}

/* Commented out
{total_curr_assets_allowed} = {ca_cash_allowed}+{ca_marketable_sec_allowed}+{ca_contract_rec_allowed}+{ca_retainages_allowed}+{ca_other_receivables_allowed}+{ca_unbilled_work_allowed}-{ca_less_allowances_fda_allowed}+{ca_notes_rec_allowed}+{ca_inventories_allowed}+{ca_costs_insx_billings_allowed}+{ca_investments_jvs_allowed}+{ca_taxes_refundable_allowed}+{ca_other_allowed}+ {misc_ca1_allowed}+{misc_ca2_allowed};

{total_assets_allowed} = {total_curr_assets_allowed} + {total_nca_allowed} ;

{net_quick_allowed} = {total_curr_assets_allowed} - {total_curr_liab_allowed} ;

{net_worth_allowed} = {total_assets_allowed} - {tla} ;
*/

Hi, You must have know your trigger fire only when you save changes. so event ajax does not fire trigger and your field for TOTAL does not be updated.
Only if you save changes the trigger is fired. so what you need update your field TOTAL in a event ajax…, you must to create a function in DB and call it function from your event ajax.
And in your trigger call the function for your field TOTAL.

If your code in event ajax does not work. maybe is your code have a sintax error. so you need do a trace, i think you must comment piece of code and look when does not work.

Im on mobile and can’t look OK the code, but…75events with 500lines each? Are you serious?

Yes, I’m serious…this is a financial analysis system for an insurance company. I have striven to give them everything they wanted and that involves a lot of fields on each screen, and the ability to analyze in a variety of ways.

Thanks Alvagar for your advice. I ended up just doing a lookup after the update event to get the totals.