Check if Fields Changed and Update Database for Audit Feature

I am writing a function to check if the field has changeed and update the database.
Eg. on the orders table, i want to show if a salesperson has updated a field and store that in the orders_history table.
I can write most of the code myself but how do I compare the previous fienld value to the new value?

For example, I know fields are referred to with brackets like {fieldname} in script.

Is there a way to check if {fieldname} orginal value == {fieldname} new value?
Am I making sense?

Re: Check if Fields Changed and Update Database for Audit Feature

If you DB supports it, you could create a trigger and use OLD/NEW values for this.

If you want to do this in code, then you could store the value(s) of the fields when loading the form and then compare those to the field values on save. There is no built-in function provided for you in SC5.

Regards,
Scott.

Re: Check if Fields Changed and Update Database for Audit Feature

tHANKS