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.

Portal row background based on calculation/script

Featured Replies

Hello!

I've got a problem and hope that someone can solve it for me.

I've have on file with undefined number of records. Each record contains two fields. One field is a text field and contains different kinds of training intensities (A1,A2,A3 etc). The other field is a container field containing a colarbar.

Then I've a second file with a greater number of fields (maybe 15). One of these fields uses a valuelist based on the values from the text field in the first file.

Finaly I've a third file wich is a calender. It contains portals which through a relationship will show values from the second file. This file works fine overall but I'm trying to use the colorbars from file one as background in the portalrows in file three (taking the colorpict from the record in file one with the same intensity value as the one shown in the relationfile from file two).

I think I've made it a litte bit harder than it should be?? Is there a other way? It would be a bonus if each user could define for him-/herself which color the wanted to representing the different intensities.

Hope that you understand wthat I'm trying to do.

You can make it so a single global container has the color to use.

I'd use globals for the original color containers, e.g. g.BG.Color.Blue, g.BG.Color.Red. The user could specify their color choice using another global, g.MyBG.ColorText, with a popup menu having a value list of colors. Then a calculation could return their preferred color:

gc.MyBG.Color=

Case (

g.MyBG.ColorText = "Blue", g.BG.Color.Blue,

g.MyBG.ColorText = "Red", g.BG.Color.Red,

...

)

If you name the colors in the Value List to exactly match the field names, you could use a GetField instead of the Case:

gc.MyBG.Color=GetField("g.BG.Color." & g.MyBG.ColorText)

Don't forget: for each of these background fields, format "Graphic..." to Reduce or Enlarge image and uncheck Maintain original proportions.

  • Author

OK, if I understand you correct this will enable the user to choose a color for each intensity.

But how do I get the calender to do the intensity match?

  • Author

Currently all records in the portal take the color that matches with the first record.

I've set red color for "AI" and blue for "AII". The portal displays two records, record one have the intensity of "AI" and record two have "AII". If I do a sort that places record one first both records get the BG color red and if record two comes first both get the BG color blue.

Hi,

A small attachment could help here, but as it seems the colorfil in portal is always the same as the one from the "first" record, then I'd suspect the calculation you're using doesn't use the same relationship than the portal.

  • Author

First I want to thank CyborgSam and Ugo DI Luca for helping me, it means a lot!!

The calculation uses the same relationship as the portal. Would be interesting to see one of thoose attachments. What do people normally do to get this to work, I mean, there ain't anusual with calenders were different appointment types are represented with different colors and in some of them the user has to be able to choose the colors by himself.

Define an relationship from your second file to your first file (Supposing the text field in first file is named "intensitiesField" and the valueList field in second file is named "intensitiesList", define an relationship intensitiesRel:intensitiesList--> intensitiesField)

Now in your second file define an unstored calc filed of type container as:

intensitiyColor=intensitiesRel::colorBarField

Put intensitiyColor as background field for your portal.

That's it

Dj

  • Author

It works just fine now, THANKS!

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.