Yeah I know this is possible through embedding a javascript, but like you
stated tweaking existing time fields to exhibit that behavior would mean you
bring it into the Remedy realm. I  have worked at a few sites where if you
were to use custom java code or code borrowed from the internet - they go
absolutely not. Its not OTB so you are not allowed. They attribute their
rigid approach to company policies to keep things OTB as much as possible to
lower costs of maintenance of their applications. Its not very uncommon. So
it gets hard to sneak foreign stuff under the covers. I  have even worked at
some companies that even denied me creating my own DB views of certain
things to show up as custom view forms.. Leave alone using external java
code..

 

Joe

 

  _____  

From: Action Request System discussion list(ARSList)
[mailto:arslist@ARSLIST.ORG] On Behalf Of Jason Miller
Sent: Thursday, October 10, 2013 11:49 AM
To: arslist@ARSLIST.ORG
Subject: Re: RFE: A Countdown / Timer / Stopwatch type field...

 

** 

That was my first thought as well.  Using Javascript it is a bit difficult
to take a workflow action when the time is up though.  Not impossible, just
outside the "normal" Remedy realm.  Joe's Idea would bring this back into a
pure Remedy realm.

 

Sylvain YVON has posted some great documentation around making Javascript
with with Remedy workflow; including how to call an AL Guide via Javascript.

 

Enhancing MT user <https://communities.bmc.com/docs/DOC-21816>  experience
with JavaScript; Part 1

Enhancing MT user <https://communities.bmc.com/docs/DOC-21818>  experience
with JavaScript; Part 2

 

Jason

 

On Thu, Oct 10, 2013 at 5:17 AM, Jim Bruce <jimjbr...@yahoo.ca> wrote:

Hi Joe, you can also implement this with a small bit of Javascript code ...
added to a View Field should do the trick,
or to target a display only field change the reference of "idCountdown" to
your "arid" field (eg. arid888000111).

<html>
<body>
<span id="idCountdown"></span>
</body>

<script type="text/javascript">
// Countdown from a set number of seconds (eg. 300)
// OR set future date to countdown from (eg. end of epoch time)

// *** INSTRUCTIONS *** uncomment either of the next two lines
var target = new Date().getTime() + (300 * 1000);
//var target = new Date("Jan 19, 2038").getTime();

// time vars
var dd, hh, mm, ss;

// function to update countdown every second
setInterval(function () {
  // seconds from now until target
  var now = new Date().getTime();
  var seconds = (target - now) / 1000;

  // parse seconds into time vars
  dd = parseInt(seconds / 86400);   seconds = seconds % 86400;
  hh = parseInt(seconds / 3600);   seconds = seconds % 3600;
  mm = parseInt(seconds / 60);
  ss = parseInt(seconds % 60);

  // find and set id="countdown" in document
  document.getElementById("idCountdown").innerHTML = dd + 'd ' + hh + 'h ' +
mm + 'm ' + ss + 's';

  // indicate when countdown has completed
  if (ss<0) {
      document.getElementById("idCountdown").style.color = 'red';
  }
}, 1000);
</script>
</html>

Hope this helps.
-Jim

____________________________________________________________________________
___
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
"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