Page 1 of 1

accessing current field contents

PostPosted: Mon Dec 26, 2011 10:52 pm
by kedikatt
I am initiating an action either before or after a record is saved/updated.
It is just an action to subtract a value entered in a field in the record from a field in another table.
How do I get the value from that field so I can pass it to the action?

User enters the number 10 into the field named Quantity. The action subtracts the value in Quantity field from some other field.

So I need to get the current value in the field Quantity before the record is saved. Or immediately after, if the field values are still available before any other action deletes them.

Re: accessing current field contents

PostPosted: Tue Dec 27, 2011 7:17 am
by ADobkin
This isn't a specific answer to your question, but it should help point you in the right direction. Take a look at the triggers in the delegate class methods, defined here:

http://xataface.com/wiki/Delegate_class_methods

The details for the beforeSave trigger should be helpful:

http://xataface.com/wiki/beforeSave

You can always search the forum for more examples of these triggers and how others have used them in their applications.

Alan

Re: accessing current field contents

PostPosted: Tue Dec 27, 2011 11:43 am
by kedikatt
Great example. Thanks.