ust a quick scripting tip today based on a solution that I helped someone with on the ServiceNow community site. The request I received was to be able to change the form header background color based on changes to values in a record. You’re probably aware that ServiceNow provides a global CSS property to set the form and list header color. This is usually one of the first things that gets customized during a deployment. The global property can be found by navigating to System Properties -> CSS, and changing the ‘Banner and list caption background color’ property.
This request required something more dynamic so that the color could change based on specific table and record values and specific changes to a specific form. In order to accomplish this, I came up with a simple client script that can be used anywhere you need it.
had a customer ask me this morning if it was possible to change the number prefix for records in the Change Request table. Specifically, they wanted to change the prefix from the default ‘CHG’ to ‘RFC’. The answer to this question is ‘Yes’, but there are a couple of things you need to do and be careful about…especially if you’re changing the prefix in a table that has existing records using the prefix. In this post, I’ll explain how you can adjust the number prefix of a table using the ‘Number Maintenance‘ module. I’ll also show how you can use a script to adjust the number prefix on existing records.
had a colleague come to me recently for help on a client issue. The customer wanted two things; the first was to set up the capability to warn users when they were navigating away from a modified form without saving it, but to do this only on selected forms rather than globally. The second was to modify the text included in the alert dialog to be whatever they wanted. In this post I’ll explain some of the options that ServiceNow provides in this area and how you can get even more flexibility and control over this behavior through scripting.
ere are a couple of script examples you might find useful. Say you’ve got a multi-line text field or variable that contains a lot of text. To save time in scrolling (or clicking the ‘+’ icon next to the field) to see all of the text you just want to auto-expand the height of the field to fit its contents based on some other client-side trigger. Here are a couple of scripts that allow you to do that.