THURSDAY, JANUARY 19, 2017

Category: Scripting

Schedule-based Date/Time Addition

I

was recently asked to help a colleague figure out some date calculations based on a schedule. The requirement was to calculate a future date based on the existing value of a date/time field. I decided to document this solution (and come up with a solution for a similar problem…date addition from the current date/time based on a schedule). Working with dates and schedules can really be a pain if you don’t have good examples to work from so hopefully these help somebody at some point. Read on for the full scripts.

Read more ...

Modifying the Label of Form Fields With Client Scripts

H

ere’s a quick tip for a Monday. This post comes in response to a question on the ServiceNow forums asking if it is possible to change the label of a field dynamically based on some record criteria (such as record type). It is possible, and this post will show you how it can be done.
Dynamic Field Label

Read more ...

Animate ServiceNow with jQuery and Prototype Effects!

A

while ago, I was trying to figure out how I could add some javascript animations and effects to a ServiceNow instance. What I really wanted was something like the jQuery Effects API but I didn’t want to have to incorporate a separate API and deal with the loading the bulk of jQuery everywhere in the instance. I knew that ServiceNow provided some limited collapse/expand effects but I was hoping for a little bit more.

I’m happy to report that I found it! Somebody smarter than me decided to convert the jQuery effects library for use with Prototype (which ships with ServiceNow) and incorporate those effects and animations directly in ServiceNow.

ServiceNow Prototype Effects

Read more ...

Building a CI Change Calendar Macro – On The Fly

A

co-worker asked me for some help yesterday fulfilling an interesting requirement. He needed to set up a configuration item reference field or catalog variable that would display a calendar macro that, when clicked, would open a popup window containing a change calendar report for that configuration item. I figured this idea might be of use to others so I’m posting it here!

CI Change Calendar Report Macro Popup

Read more ...

Set Default Date/Time Picker Dialog Time

H

ave you ever wondered how you can change the default time displayed in a Date/Time dialog? In general, the Date/Time dialog is controlled by back-end code so there’s not much you can do with it. I’ve seen this question a few times now so I decided to come up with a solution.

Date Time Picker

Read more ...

Latest Comments

  • David: It appears that I can hit sys_properties table with REST. This works, but I haven’t yet discovered the...
  • Mark Stanger: Hey David, It doesn’t surprise me that scoped apps have made this more difficult. I’m not...
  • David: Mark, do you have an example of how to do this in a scoped app? It seems there are many hoops to jump through...
  • Mark Stanger: The only possibility is to create a system property to override this in your application. Check out the...