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.

Changing the Colour of a text area or other object

Featured Replies

I know in FM 7 you can manipulate text colour, font, etc. based on the value of the text (such as if status is Open, the text is green, if it is closed, the text is red).

BUT, is there a way to manipulate the background colour of a text area the same way?

Reason for my asking is that I have a button to submit a record. Over that button I have a text area with a transparent background showing the status (unsubmitted). I want to change the background colour of the text area to match the background of the record/layout when the record is submitted, so the button "disappears".

A couple of members on here helped me with the same thing, here is what helped me. If you need a copy of the database I worked on let me know.

Generally you need a new calculation field and some global fields. The calculation would look something like:

Case(

fieldname = "Bronze"; g_bronze;

fieldname = "Silver"; g_silver;

fieldname = "Gold"; g_gold;

g_white)

Into the g_fields you insert a rectangle with the respective colour, which is displayed by the calc field depending on the content ot the original field. You only have to make the calc field an exact copy of the original, place it behind and make the original transparent.

Dave

If your global fieldnames contain the desired color, as in Dave's example, you can use GetField instead of Case.

GetField("g_" & fieldname)

If the field background is white, then you shouldn't need a g_white either, as it would be blank if there were no result.

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.