Postrecalc Web replacement

I am working on updating a time card application that works fine using the Notes client but now needs to be available via a web browser and Domino Web Access (iNotes). Please keep in mind that I am fairly new to Domino programming and try to overlook my ignorance. Everything so far works fine with the exception of one section that calculates the totals for two weeks of work. The code for this function is using the event Postrecalc which doesn’t work in the browser. What is another way to accomplish the same thing as the Postrecalc using something else that works in both browser and client? I can post the code if you’d like. Thank you in advance.

Subject: Two ways

Easy way: add a button with @Command([ViewRefreshFields)

Hard way: write a javascript function to calculate the totals. Trigger the function using the onChange event of each field.

Subject: RE: Two ways

There is already a Refresh button on the form with the @Command([ViewRefreshFields) but it won’t refresh the totals for me. Every other field refreshes just fine. I may have to look at the “Hard Way” as you put it.

Below is the code for Posrecalc event just in case anyone has any suggestions.

total1 := w1RHT + w1PHT ;

diff1 := @If( total1 > 40 ; total1 - 40 ; 0 ) ;

rh1 := @If( diff1 > 0 ; w1RHT - diff1 ; w1RHT) ;

oh1 := diff1 ;

total2 := w2RHT + w2PHT ;

diff2 := @If( total2 > 40 ; total2 - 40 ; 0 ) ;

rh2 := @If( diff2 > 0 ; w2RHT - diff2 ; w2RHT) ;

oh2 := diff2 ;

@SetField( “RH” ; rh1 + rh2 ) ;

@SetField( “OH” ; oh1 + oh2 )

This is supposed to take the total hours worked for each week and populate two fields at the bottom of the form “RH” (regular hours) and “OH” (overtime hours)

Thanks for your help.

Mike

Subject: Calculations

Put the calculations in the OH and RH fields.

Subject: RE: Calculations

The code I posted declares some variables which makes putting the calculations in the fields a bit more complicated. I have tried to create some hidden fields that have the basic calcualtions thus replacing the variables. The problem I have with this is that it will not total the OH field until it is saved, re-opened and then refreshed. Using the refresh when editing the form does not properly total this field for some reason.