yaya Posted May 26, 2008 Posted May 26, 2008 question about validating. See attachment FM9 file, contain 2 small table. 1. table User fields: userId Text unique auto increase UserName text 2.Table Service Fields: user ID Text (value: User::UserId) user name text (value: drop-down list from the value of User:Username Service text (select from drop-down list) (given sample sevice name cleaning,gardening,teaching ...) Relationship user::Username --< Service::Username random added some sample user names from table user. (e.g. peter, simon, jon) Now, I'd like to add service to those users from table Service. each record contains one user and one service. Record 1, say, Peter, given service Cleaning. Record 2, Peter, Gardening Record 3, Simon Gardening I don't want to same user has same serive, say I want a warning from FM system that Peter has already has cleaning,to prevent we add cleaning to Peter again. (I can not set service field unique, because other people say Jon could have cleaning) Once Jon has cleaning, he can have any other more services but we don't allow him has cleaning again. How can I implement it. I've been thinking so long time and didn't get it : thank you very much for help. validation_service_filed.zip
comment Posted May 26, 2008 Posted May 26, 2008 See if this helps: http://www.fmforums.com/forum/showpost.php?post/204677/ See also: http://www.fmforums.com/forum/showpost.php?post/246743/
yaya Posted May 27, 2008 Author Posted May 27, 2008 thanks, seems the 1st way is easier. Once question. from your ansewr, what operator is "|", especially the |, I didn't see it from the operator buttons there. Thank you. 1. In the Appointments table, define a text field, set it to auto-enter a calculated value = CustID & "|" & GetAsNumber ( AppointmentDate ) & "|" & AppointmentTime Uncheck the "Do not replace existing value.." option. Set the field's validation to 'Unique value'.
comment Posted May 27, 2008 Posted May 27, 2008 It's not an operator. It's just a text character (note that it's surrounded by quotation marks) chosen to separate between the concatenated values. It is assumed that the values themselves will never contain the separating character. Without the separator, or if the above assumption is not true, you might get ambiguous results, e.g. "1" and "23" combined to produce "123" will prevent the creation of otherwise legitimate record of "12" and "3".
yaya Posted May 27, 2008 Author Posted May 27, 2008 thank you very much, I used the 1st method and it works perfeck, thanks again for help.
Recommended Posts
This topic is 6084 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now