Save Calculated fields from Form to table

Hi all… I am working with one cutomized module-training registration form. Train Reg. Header & Train. Reg. Line. Now on Tran. Reg. Line i have Training Cost: Decimal Extracharges: Lookup field:DrillDown to Charges table (Map with Charge Amount field.) Total Cost:Decimal. Now Total Cost will be Training Cost+Extracharges. It works fine on form level by using OnAfterGetRecord trigger of form. I can see the updated Total Cost But it doesnt change the value of Total Cost in tables. I think there is a probs due to Extrachages field (Flow Field). Please help me. Its v. urgent… Thnx in advance… Sachin…

Sachin, I imagine that the code you’re using in OnAfterGetRecord is something like this: CALCFIELDS(ExtraCharges); TotalCost := Training Cost+Extracharges; To save this value in the table, you need to do: Rec.MODIFY; Alastair

Thnx… But where should i write the code rec.modify. I cannot use that one on form level. specifically OnAfterGetRecord or OnAfterGetCurrRecord. It will give me error like you cannot use this trigget to change the database. I tried with Form.saverecord But it doesnt work may be i dont know the place where should i write that… confirm the same. Sachin…

Sachin your desing is wrong, modifying records from froms like this is not the correct path. Rethink your model, and add code somewhere as a table level trigger