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

Must be Unique Except in one case.

Featured Replies

Setting up a field to store IP address. I want the field to require a unique value except when its set to the value DHCP.

I'm never really dabbled with Validation other than default options when defining a field. I'd appreciate any help in getting me started in the right direction on this one.

TIA.

You might try something like this (attached)

uniqueExcept.zip

  • Author

That is exactly what I need and it works beautifully but could I ask you to help me understand it a little more? The logic is escaping me.

If I get it the first part, IPaddress = "DHCP", FM saying if the field is DHCP it okay and it passes validation.

but the , or IsEmpty (selfjoin::IPaddress), Is where i'm getting lost. The "IsEmty" FM is saying if the field (related field) is emtpy it passes validation.

But I don't see how it fails when they are the same.

Thank you so much for the example.

The "IsEmty" FM is saying if the field (related field) is emtpy it passes validation. But I don't see how it fails when they are the same.

Since validation happens before record commit, it will not accept ANY IP except the first time it is created (because it expects NO related records). If there is ANY matching related record, it means that there is another identical IP already existing. And since we are validation ALWAYS and not only when the record is modified, the validation fires first and refuses to accept the duplicate IP.

But I hope you are seriously checking Comment's suggestion because another field holding the DHCP saves creating a selfjoin relationship at all.

  • Author

Yeah I'm looking at both. But really want to understand yours as validation by calculation is still foreign to me.

Although I wouldn't have thought of comments example on my own it was straight forward and easy to understand. Which for me might be the right choice in the end.

Thank you both for taking the time to post examples.

Create an account or sign in to comment

Important Information

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

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.