August 1, 200520 yr Ok I have an auto enter calc that works perfect. We have codes, if the codes isn't statused as being used,( inactive, available...) the appropriate message appears in that field stating the code is basically invalid. Great! But I want to use validation to prevent the record from being committed if the code is not of the correct status. I have tried a few things like validation with requiring strict data type of numeric... but that doesn't work and it screws up my whole autoenter calc. Can this be done... Should I post my file for a lookover? Thanks -Mike
August 4, 200520 yr Try validating the code field with the inverse of your auto-enter calc test. For example, if the auto-enter calc is If( Codes::Status = "inactive"; "invalid code" ) use Codes::Status <> "inactive" for the validation.
August 15, 200520 yr Author hmmm below is my auto-calc, how would I go about making the validation. Maybe I should have posted this the first time. Here we have the status as "I" for invalid and we have the code as available.. yes it is stated in another field but that is how they have been doing this for years now. Let ( [ strip = Filter ( FMPcodeslist::Tabs status ; "I" ) ; strip2 = Filter(FMPcodeslist::OA ; "available"); invalidresponse = TextColor("INVALID CODE "; RGB(255;0;0)) & TextStyleAdd ( Client_Code ; Bold ) ; validresponse = TextColor ( Client_Code ; RGB ( 0 ; 0 ; 0 ) ); response = Case( "available" = strip2 ; invalidresponse; not IsEmpty(strip); invalidresponse; validresponse) ] ; response )
August 15, 200520 yr I would suggest trying Filter( FMPcodeslist::OA; "available" ) <> "available" and IsEmpty(Filter( FMPcodeslist::Tabs status; "I" )) as your validation calculation for the code.
August 22, 200520 yr Author Ok maybe I am just too much of a novice, but don't I need the validation to say something like if the client code is not strict numeric, then don't committ? I have tried this but it gave me an error The OA and tabs status are "checks" to see whether the client code(numeric) will stay as input or change to red with the word "invalid" before it.
August 22, 200520 yr You can also select the 'Strict Data Type: Numeric Only' option, then deselect the 'Allow user to override' option. If the validation calculation returns zero (false) or the code is not a number, then your custom message (assuming you enter one) will be displayed and the record cannot be committed.
August 23, 200520 yr Author I have tried a few things like validation with requiring strict data type of numeric... but that doesn't work and it screws up my whole autoenter calc. it does this by not allowing the auto-enter calc to enter in the "Invalid Code" in red text before the numeric code. And eventhough the code is incorrect it allows committing of the record. Should I post my DB? I think I might have done something backwards.
August 23, 200520 yr What is the calculation for FMPcodeslist::OA? Can you include it in the validation instead of referencing the field? Is it located in the same table? If so, field creation order may be to blame. Feel free to attach a clone of your file.
August 23, 200520 yr Author Attached is my sample file. In the FMPcodelist table is the 5 possabilities of what :OA can be Time_Entry.fp7.zip
August 24, 200520 yr Author oh I am sorry I tried to edit the post but I guess it didn't take.... user is Admin no password
August 26, 200520 yr Author Ok can anyone figure this out? -Queue- made some good tries but for somereason they don't work... i attached the file to a few posts before, with the username admin and the password being blank..... if anyone could take a look at this I would be very very greatful. even if you look and can't figure it out let me know... maybe i will startover from scratch!
Create an account or sign in to comment