Jump to content

Coloring portal records


This topic is 5795 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I have a calendar layout with a portal that shows all Jobs for a Day. There are multiple Jobs per Order. The portal is sorted by start time, but different Jobs on the same order may start at different times. It would be unusual to have more than 10 different Orders (and 30 Jobs) per day.

I'm trying to come up with a way to assign a highlight color to each Job of the same Order. Having the same color to an Order over multiple days would be ideal, maybe required. An Order would rarely have Jobs that cover a span longer than 2 weeks. It's unlikely more than 20 Orders would ever overlap.

I imagine it would require a deconstruction of the Order id and a custom function involving RGB(), but I'm stumped on where to begin.

Has anyone tried something similar?

Edited by Guest
Link to comment
Share on other sites

You could assign a color to each order in the Orders table, and use it to calculate the background color in the Jobs table. I don't see where a custom function would be needed for this - except perhaps to determine the color?

Another option would be to use conditional formating, but this would repeat the color every n orders - n being the number of conditions in the formating.

Link to comment
Share on other sites

I'm trying to figure out how to assign a color to an Order ID. There's x number of useful colors. How do I parse an Order ID (5 digit, currently about 2000 records) into a color? How do I parse it into a color that is not (or is unlikely to be) the same as the color of another Order that may have Jobs on the same day? The number of combinations is bound to be greater than x. What is x?

Conditional formatting may work, since prescience isn't needed, but I don't think it'll keep colors consistent over multiple days and I'm not sure what that conditional formatting would look like.

Link to comment
Share on other sites

Let's say you have defined n colors and numbered them from 1 to n.

Mod ( OrderID - 1 ; n ) + 1

will assign the colors to orders cyclically.

The same thing, albeit with more work, can be done with conditional formatting directly in a portal to Jobs:

Formula is: Mod ( Jobs::OrderID - 1 ; n ) = 0 | Fill Color 1

Formula is: Mod ( Jobs::OrderID - 1 ; n ) = 1 | Fill Color 2

Formula is: Mod ( Jobs::OrderID - 1 ; n ) = 2 | Fill Color 3

...

Formula is: Mod ( Jobs::OrderID - 1 ; n ) = n-1 | Fill Color n

In both methods, the colors are assigned to orders permanently, therefore the number of required colors is the number of new orders that can be created during the "useful lifetime" of any order.

Link to comment
Share on other sites

I know I have done this before, but I can't find it - someone asked about coloring every n-th row.

Anyway, one way is to type "@@" into the portal and format it conditionally using Mod ( Self ; 2 ). I didn't get the part about hiding some text.

Link to comment
Share on other sites

Sorry I had deleted my post... (I thought in time.)

The orig question was I wanted to see how you would handle conditional formatting with portals with alternating colors... I have a work around method but I was curious to see how you would handle it.

Link to comment
Share on other sites

Yes but what about other objects such as fields etc? How to conditionally format them. There are certain object that I make disappear/appear with conditional formatting usually by matching the background color... However, with alternating portal rows, this woouldnt work.

Link to comment
Share on other sites

This topic is 5795 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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