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.

Conditional Formatting?

Featured Replies

Is it possible to apply conditional formatting to a layout in FM similar to excel, whereby alternating lines could be given different background colors for easier readability? (i.e., line 1 is gray, line 2 is white, line 3 is gray, line 4 is white)

Courtney:

You can do this within portals, which is one of the things that makes a portal so handy for showing lists of data.

-Stanley

  • Author

Thanks for the response. Is there a particular term that would help me narrow down my search for how this is done?

~Courtney

Portal Setup | Alternate background fill

Courtney:

If you know how to create a portal, double-click on the portal in layout mode, and you will see the option to "alternate background with" and then a color box, where you can choose your alternating color.

-Stanley

You can also use a global container field with two repetitions and one color stored in each, and a calculated container field equal to GetRepetition( gContainer, not Mod( Status(CurrentRecordNumber), 2 ) + 1 ), which will return the first repetition for odd records and the second for even ones. Put this field in your body part and format it as desired, making sure to disable entry into it.

  • Author

You can also use a global container field with two repetitions and one color stored in each

Ok, got that set up, and named it gContainer.

and a calculated container field equal to GetRepetition( gContainer, not Mod( Status(CurrentRecordNumber), 2 ) + 1 ), which will return the first repetition for odd records and the second for even ones. Put this field in your body part and format it as desired, making sure to disable entry into it.

This makes sense to me, but I'm apparently doing something wrong, because I'm not getting anything in the calculated container field (which I named Background). I set up a layout to display each field separately, so I could maybe see what I was doing wrong, and my gContainer field displays the two colors horizontally as I set it to do, but the Background field does not display either one of the colors.

Any clues to what I may be missing?

  • Author

Digging a little deeper... when you say "calculated container field" should that be a calculation, where the result is a container? Or a container field with an "auto-entered" value equal to the calculation? (I have tried both, but I suspect the latter is more correct than former.) Or is it something else altogether?

  • Author

Well I figured it out just by modifying the formula:

If( Mod( Status(CurrentRecordNumber), 2 ) , GetRepetition( gContainer , 1 ) , GetRepetition( gContainer , 2 ) )

(Just posting in case anyone else is searching for a similar solution.)

~Courtney

Sorry, that should have been

GetRepetition( gContainer, (not Mod( Status(CurrentRecordNumber), 2 )) + 1 )

  • Author

So now that I have my background color being generated properly, I'd like to generate two reports based on two different layouts (and sorted in two different ways). How can I make the background field update itself based on the sort (which changes the CurrentRecordNumber)? Relookup doesn't seem to be the answer.

~Courtney

I'm not sure I understand the question. The current record number is dependent on how the items in the found set are sorted. It naturally updates for each sort order, as long as the calculation is unstored. Record number 1 in one sort order may be record number 4 in another. In the first case, the calculation will contain the first color; in the second, it will contain the other color.

  • Author

I figured out my problem or at least a way around the problem. Although the record numbers were changing according to the sort, as is logical, the "background" wasn't "recalculating" based on the new value of the record number. (Even a relookup would only change some fields and not others - I'm not sure why.) So I'm writing a script to clear all values in the "background" field, and do a relookup each time the sort is performed. Preliminary testing looks like this will make it work as expected.

Thanks for all your help.

~Courtney

Did you make the container calculation a calculation field or a container with an auto-enter calculation? It should be an unstored calculation field with a container result.

  • Author

That fixed it! Thanks so much. I had a container field with an auto-enter calculation.

Create an account or sign in to comment

Important Information

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

Account

Navigation

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.