dbTalk Databases Forums  

Field Validation question

comp.databases.filemaker comp.databases.filemaker


Discuss Field Validation question in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
bilbod
 
Posts: n/a

Default Field Validation question - 12-08-2009 , 10:41 PM






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.
Thanks,
Bill

Reply With Quote
  #2  
Old   
bilbod
 
Posts: n/a

Default Re: Field Validation question - 12-08-2009 , 11:08 PM






I've thought of something here. A calculated Replace that sets any
d_closingdate to TexttoDate "" if Amount Owing is > 0. Having that
script run as the report starts sanitizes the invoice list.
Sometimes you just gotta put it into words!
Bill

Reply With Quote
  #3  
Old   
Your Name
 
Posts: n/a

Default Re: Field Validation question - 12-08-2009 , 11:44 PM



"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 )

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.