2

I am trying to change the colors of lines displayed in my portlet based off of a date range. The following are examples of what I am trying to do.

  1. within the last 7 days - green
  2. greater than 7 days - red.

I have tried the following expressions :date - 7 and it does not work, I am assuming as there is not an overloaded operator to handle the subtraction between a date object and a integer. Also for the expression field, can it handle function calls? As I have also tried to use getdate() which does not work here.

  • What version of Maximo are you using? When you say portlet, you mean start center? Can you provide an image of what you're trying to do? I don't like SigOptions but it is one way to do possibly: https://www.ibm.com/developerworks/community/blogs/a9ba1efe-b731-4317-9724-a181d6155e3a/entry/How_to_change_field_colour_in_Maximo_7_6_using_Conditional_Expression_Manager?lang=en – Sun Aug 30 '19 at 23:40

1 Answers1

1

Assuming you are talking about a ResultSet portlet on a Start Center, date math has historically been abysmal in this context. You would be better to write an Automation Script to support a new Function and then call your Function from an Attribute Formula. You can then do your color coded rows against the integer attribute you associated to the Formula.

The only thing I found lacking in the relevant Help and product documentation was that your script needs to return its calculation result in a variable called retval or whatever it is for Custom Condition launch points.

Preacher
  • 2,127
  • 1
  • 11
  • 25
  • How to associate the automation script function with the attribute formula? – Swaroop Apr 17 '20 at 09:36
  • @swaroop, if you have tried to follow "the relevant Help and product documentation" and found more lacking than I did, then I suggest you start a new question and say what you've done and what isn't working. – Preacher Apr 17 '20 at 17:37