Highlighted
Absent Member.
Absent Member.
350 views

How to change a color of Screen based on Value in certain Field

Hi All,

 

I have a requirement where in if a User entered is VIP User, the color of Screen should change.

 

Please suggest how can this be achieved.

-HB

0 Likes
2 Replies
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: How to change a color of Screen based on Value in certain Field

It's not possible, to my knowledge, to change the color of the screen based on a condition.  You can create a label of a certain color and then use the Visibility condition to appear when the User is a VIP.

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: How to change a color of Screen based on Value in certain Field

I found some old notes that mentioned that this could be done. I think examples can be found in the dep.g. This is for DVD and it may not work in all areas.

Field Value Matching:

Basic Syntax: [FIELD] ? ValueList : DisplayList
Where [FIELD] is any variable or file field surrounded by brackets
ValueList and DisplayList are comma-separated values.

For example, if you wanted the color of the ‘priority’ label within problem management to change based on the severity of a problem ticket you could place the following in the ForeColor Condition for the priority label object:

[priority.code]?”4”,"3","2","1":0,2,7,1

• priority.code is the field that you are basing the color change on.

• ”4”,"3","2","1" is the list of values that priority.code could be equal to

• 1,7,2,0 is the list of codes defining the colors that you want the label to change to based on the list of values for priority.code

In the case above, the text for the ‘priority’ label would change to red for a priority 1 ticket, yellow for a priority 2 ticket, green for a priority 3 ticket, and black for a priority 4 ticket. Adding another number to the end of the DisplayList would create a default color if the priority.code has some other value than any listed in the ValueList.

Some of the color to number relations are as follows:
0: BLACK
1: RED
2: GREEN
3: DARK BLUE
4: GREY
5: LIGHT GREY
6: DARK GREY
7: YELLOW
8: CYAN
9: MAGENTA
10: WHITE
11: DARK GREEN
12: BLUE
13: PURPLE
14: TEAL
15: BRICK
16: LIGHT YELLOW

This type of conditional statement allows you to call a function that is evaluated dynamically. An example of this functionality can be seen in a canned system on the apm.quick format. Depending on the category chosen the values in the subcategory drop-down change dynamically.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.