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.

"Hide Object When" calc help needed

Featured Replies

All this field's negativity...maybe that's why I'm having a problem coding a calc for it.

 

I have a text box warning field I want to use to alert a user that if the PrintChoice field contains either the phrases "Last Visited" or "Status" and the radio-button'd SortChoice field doesn't have either the Ascending or Descending button chosen, it'll "light up".

 

Where I'm having a problem is parsing the PrintChoice field. I tried using:

 

PatternCount ( PrintChoice ; "LastVisited" ) = 0  or PatternCount ( PrintChoice ; "Status" ) = 0

 

...with...

 

IsEmpty ( SortChoice )

 

...but the calc started getting clunky fast from there, logic-wise. Surely (don't say it!), there's an elegant way to code this request.

 

I guess being a poor, starving database coder, I belong to the world of have nots.

why don't you post the whole calc that you have now...

Is PrintChoice a checkbox field? Doesn't sound like it. So why not simply test for =

PrintChoice = "LastVisited" or PrintChoice = "Status"

Alternatively, use =

not IsEmpty ( FilterValues ( "LastVisited¶Status" ; PrintChoice ) )

This will return true if the field contains either of the values - so this will work in case the field is a checkbox.

 

 

I am also not sure why you allow SortChoice to be empty (or, alternatively, why don't you make Ascending the default choice and only require user entry to override it).

  • Author

Thanks, Comment, and you too, Wim.

 

Correct, it's not a checkbox'd field.

 

The question of sorting is a good one, Comment, and I'd appreciate your input (as always!) on this:

 

What's "best practice" when it comes to sorting? Normally, whenever a field is alpabetic, I hard-code an ascending order in lists and reports since that's how we normally want to see things. However, it gets a little dicey when it comes to dates since some people prefer ascending order and others descending order. (In my experience, Accounting types prefer decending order.) I don't know if it's good practice to set a default sort order for dates since I don't want to annoy users who prefer one over the other, so that's why I left it unchosen. Your thoughts?

 

As for the Status field above, that's a gray area since there are three choices for it: Active, Inactive, and Undecided. Should I hard-code that in ascending order as well as the other "alphabetics" or leave it empty for a user to choose whether s/he wants to see Undecided records, first?

From a data perspective, sort order is a Boolean. You cannot perform a sort if the sort order is empty or "unknown" or "undecided" or "a little bit of both". The natural container for this type of data is a Number field where 0 (or empty) represents the default choice and 1 (or any other non-zero number) represents an override.

 

On top of that, you have the user-interface to consider. It's more difficult to advise about that, knowing so little. There are some established conventions, however, that you could consider - such as clicking the header to reverse the sort order (with an icon indicating the current choice), or a pop-up menu.  But even if you decide to go with your current choice of radio buttons, you shouldn't allow the field to be empty.  IMHO, making "Ascending" the default choice is acceptable (and the user who prefers "Descending" has the same amount of clicks to make as they do now). But if it's such a big issue, you could make this a part of user preferences.

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.