Anyone who's read anything I've written over the past year (that I've been
contributing here) knows I'm a big fan of using Remedy views over SQL
views. And I've used this mechanism to implement exactly what you're
looking for here, but without the table walk logic...much (much much)
faster and more efficient since the database is doing all the work.

In my case I wanted to implement something that showed a more typical aging
( < 30 days, 30-60 days, 60-90 days, > 90 days) but like you I wanted these
differences to show as colored rows in the table.  And while your
requirement is to show aging measured in hours and mine is in days, the
difference is irrelevant to the underlying solution.

I'm not going to get into any detail here unless there's some interest that
I do (it would take a bit of research & review to put it all together). I
will mention, though, that the solution requires that the DB "know" the
current time as a Unix epoch timestamp (and *accurately*, especially for
your fine grained requirement). Of course all DB's know the current time,
but accurately converting that to an epoch time (accurately!) can be a
challenge.

Since I use SQL Server and I'm a .NET guy, I was able to write a set of CLR
stored procedures that manipulate timestamps at the DB level very quickly &
efficiently, including one that returns the current time as an epoch
timestamp. If you're also using SQL Server you'd be welcome to the source
code for this (or even the compiled assembly if you prefer). But I don't
have a comparable solution for any other DB platform.

If you're interested in learning more let me know and perhaps it would be
most considerate to the rest of the community to take it offline.

-charlie

On Thu, Dec 4, 2014 at 12:38 PM, LJ LongWing <lj.longw...@gmail.com> wrote:

> **
> Omega,
> First off, I would be careful with an auto refresh every 5 min's....as
> well intentioned as that is, it can come with a cost, especially if the
> user that has that console up is a Floating user...
>
> Second...instead of an escalation keeping track of the age...I would think
> about using a 'local' field in your table, and using an AL Guide loop to
> loop over the contents of the table on refresh that sets the column to
> value in question....
>
> I only recommend that if you have 'limited' data in your table, because
> the walk takes some time....
>
> I have a table I do that sort of thing with that I limit to 50 records per
> chunk and it takes less than a second or two to walk the table and populate
> the data...
>
> On Thu, Dec 4, 2014 at 1:16 PM, Hon Li <omegal...@gmail.com> wrote:
>
>> **
>>
>> I got some incident tickets.
>>
>> I managed to create an read-only form to show the un-closed tickets, and
>> set an auto-refresh says 300 seconds by active-link.
>>
>> now my users would like to highlight those tickets in yellow in color if
>> 2-3 hr, and red in color if over 4-hr.
>>
>> So, I wonder if my following approach is correct or there is a better
>> way.
>>
>> 1. create a calculation fields says running-hr = timestamp - create-date
>> 2. create a selection-field [white, yellow, red]
>> if running-hr >= 4 , and selection field is not-red, set selection field
>> to red
>> if running-hr > 2, <4 , and and selection-field is not yellow, set
>> selection field to yellow
>> else set selection to white ( or default as white)
>>
>> in the table-field, I can then set the color according to this selection
>> field.
>> To make this running-hr , "adding", I use the "escalation" running every
>> 5-min to make the refresh frequency under the table.
>>
>> Question: do you think it will work ? have done the similar, and would it
>> be a better approaches ? Please feel free to share me.
>>
>> many thanks from your help.
>>
>> Regards,
>> Omega
>> _ARSlist: "Where the Answers Are" and have been for 20 years_
>
>
> _ARSlist: "Where the Answers Are" and have been for 20 years_
>

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
"Where the Answers Are, and have been for 20 years"

Reply via email to