Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 3919 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

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.

Posted

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.

Posted

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.
Posted
 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.

  • Like 1
Posted

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.

Posted

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.

This topic is 3919 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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