"bilbod" <bjaynes (AT) montanaport (DOT) net> wrote
Quote:
In FM 5, a user can close an invoice by clicking a Close button that
inserts the current date into d_closingdate [used for reporting]. If
the invoice is not paid up, the button fails and tells the user to
enter enough payments to equal the total. D_closingdate has calculated
validation saying Case (Amount Owing >0, "", d_closingdate). This
validation seems weak since if the user docks any payment resulting in
Amount Owing > 0, d_closingdate is unaffected. Unless the Close button
is clicked again, upon which d_closingdate reverts to blank. Since
reports are based on the closing date, I guess I need to lock it down
more. Or make it impossible to work with payments after closing. I'd
be interested to hear anyone's idea of a strategy. |
I think you're a bit confused.
Field Validation is used simply to test that data is valid - it can't
actually change the field's data. The calculation for validation has to
return a True or False result. This means your Validation by Calculation of
Case (Amount Owing > 0, "", d_closingdate)
isn't going to work in any useful way.
If you're trying to get the database to display an error message when the
user tries to "Close" the invoice that still has money owing, then it would
be besat to put the test in the "Close" button's Script.
e.g.
If [Amount Owing > 0]
Beep
Message["This invoice cannot be closed - money is still owed", OK]
Else
Set Field [d_closingdate, Status(CurrentDate)]
End If
Helpfull Harry

)