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.

Sort script with background color change?

Featured Replies

I'm trying to create a project management database for my company. I have many records, but two main categories, Active and Inactive. I figured out how to sort those into the two categories, however now I have a problem that you don't visually realize if you are looking at the active or inactive files after using the sort option.

I was hoping to find a way to make that happen, and the easiest way I could think of would be to have another background color. However, as easy as that sounds I can't figure out how to do it. Is there a step I can put in the sort script that would do this? Or ...is this even the best solution to my problem? Simply having a title that says active or inactive would work, though I beleive the color change would be more effective as they will scroll. (the sort option only being available in list mode.) I would have used the <<active/inactive>> title, but when unsorted the title stays.

Up to this point they have gone through and manually changed the colors of the fields that show up on the list mode layout. That way the text looks grayed out on the inactive files. This works, however I beleive an automated solution would be much easier and less time consuming.

Can anyone offer some suggestions? I am kind of new to the FileMaker program as well as the whole database way of thinking. I'm sure that there is a simple solution but for the life of me I just can't figure it out. Any help would be greatly appreciated. Thank you in advance.

Jess

I assume that you have a field that can define the records as active or inactive since you can sort with that as a criteria.

Create a container field with two repetitions. Copy a Red box into one repetition and a Green box into the other repetition. For the sake of example we'll call the container field "RedGreen".

Use a calculation field with a result that's a container. The calculation would be

If(Field:active/inactive = "active", GetRepetition(RedGreen, 1), GetRepetition(RedGreen, 2))

Set the calculation to "do not store"

The calculation field should now flip from red to green as the active/inactive status changes.

Phil

Note, you don't need GetRepetition for the first repetition of a field, when calculating a non-repeating field, or a repetition that matches the repetition in the field being calculated, e.g. Set Field [foo, -2, bar] will set the second rep of 2 with the second rep of bar.

So, Case( Field|active = "active", RedGreen, GetRepetition(RedGreen, 2) ) will work as well.

  • Author

Thank you for all of your help! I finally got it to work.

Jess

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.