Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to make a field required if another field is completed

Featured Replies

  • Newbies

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.

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.

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

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.

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.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.