Jump to content
Sign in to follow this  
stockingup

Validating by calculation on related field

Recommended Posts

Hi everyone. I have been messing around with this for hours and it just won't work!! I'm starting to think I'm missing something incredibly obvious.

To simplify things, I have a field called 'status' in a table called 'serviceEvents'. I then have another field called 'routeDate' in a table called 'Routes'.

Essentially, UNLESS the job in 'serviceEvents' is currently on a Route, and hence in the 'Routes' table, I want it to only allow the status field to have the value of "incomplete". Otherwise, I want it to allow "Incomplete" or "Complete" (thinking about the problem logically, it wouldn't make sense to mark a job as complete that has never been on a route - and hence can't BE complete!!).

I never seem to manage to do this. I can display the related field, and it works. I have run tests eg: if routes > 0 show a certain dialog box on a test script and that worked aswell.. However, no matter how I reference the field in a validate via calculation field, it just doesn't work.

Any suggestions??

Best Regards,

Jason V.

Share this post


Link to post
Share on other sites

Validation calculations can be done different ways, and can be tricky. In this case I'd do a "negative" test for the "not" conditions, explicitly producing a 0 (fail), but anything else is OK.

Case ( IsEmpty (Routes::routeDate) and Status = "Complete"; 0; 1 )

// or, for you minimalists

not ( IsEmpty (Routes::routeDate) and Status = "Complete" )

Edited by Guest
minimalists

Share this post


Link to post
Share on other sites

That worked like a charm. Thanks for the help... Would have spent countless more hours trying this otherwise :B

Best Regards,

Jason V.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use.