Newbies mdjoyce Posted April 26, 2014 Newbies Posted April 26, 2014 I am trying to make a field required is another field in the same table is completed by a user. Example: I have a field called "Custom Change Item". If a user inputs text into this field, I would like for another field called "Custom Change Cost" to be required. I believe this can be accomplished through a validation calculation but I cannot figure it out. Thank you for any assistance anyone can provide.
Rgordon Posted April 27, 2014 Posted April 27, 2014 I don't think you want a validation calculation. In my opinion validation calculation are not very user friendly. Here is one possible solution. After the user enters the item use an on exit script trigger to go to the cost field. Then run an on exit script trigger that will not let them exit the cost field if the cost field is empty and the item field is not empty.
Helpful Harry Posted April 27, 2014 Posted April 27, 2014 For a Validation Calculation, the Custom Change Cost is only valid: when Custom Change Item is empty AND Custom Change Cost is empty, OR when Custom Change Item is not empty AND Custom Change Cost is not empty. So that should give a Validation Calculation of ( IsEmpty(Custom Change Item) and IsEmpty(Custom Change Cost) ) or ( not (IsEmpty(Custom Change Item)) and not (IsEmpty(Custom Change Cost)) ) but I can't test that on this computer.
comment Posted April 27, 2014 Posted April 27, 2014 I have a field called "Custom Change Item". If a user inputs text into this field, I would like for another field called "Custom Change Cost" to be required. Validate the Custom Change Cost field by the following calculation = IsEmpty ( Custom Change Item ) or not IsEmpty ( Self ) Make sure to deselect the "Validate only if field has been modified" option. In my opinion validation calculation are not very user friendly. True, but that's no reason to forgo validation. Validation is the true barrier against invalid data. It works independently of any layout measures you might (or might not) have installed on a particular layout. So by all means, do use script triggers to improve the user experience - but do this in addition to proper validation. 1
Helpful Harry Posted April 28, 2014 Posted April 28, 2014 Validate the Custom Change Cost field by the following calculation = IsEmpty ( Custom Change Item ) or not IsEmpty ( Self ) Make sure to deselect the "Validate only if field has been modified" option. That one would allow a value in Custom Change Cost when Custom Change Item was still empty ... although technically not one of the stated validation requirements, it may not be a good idea to allow it and could cause strange things to appear in some reports depending on how things like totals are calculated. BUT that might be better than mine if users like to enter data "backwards" (i.e. Cost and then Item), where mine would complain with a validation error.
comment Posted April 28, 2014 Posted April 28, 2014 That one would allow a value in Custom Change Cost when Custom Change Item was still empty True. If I wanted to prevent that, I would have suggested = not ( IsEmpty ( Item ) xor IsEmpty ( Cost ) ) - if users like to enter data "backwards" (i.e. Cost and then Item), where mine would complain with a validation error. Not really - unless they tried to commit the record before filling the first (Item) field too.
Recommended Posts
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