Verifying List View selection

General No Comments »

One of our customers recently had a requirement that I would like to share here.
The customer wanted three things:

  1. Create a new record directly from the list view;
  2. Relate the newly created record to another table;
  3. Redirect to the new record.

It’s not rocket science but I need to build in some user friendly logic.
The first one, the user has to check one checkbox in the list view.
The second, it’s not allowed to check multiple checkboxes.
The third, if a record has been related previously an error message must appear on the screen.

You can download the zipped XML file using the download button below.
[download id=”3″]
Continue reading…»

Change the class of a CI

General 5 Comments »

Sometimes you may find that a CI is in a wrong class, and you need to move it to another class.
Obviously you can delete the CI and recreate it using the correct class, but if you want to preserve relationships (to Tasks or other CI’s), this may not be an option.


There are two methods that can be used to accomplish this, both with the same results:

  1. Add the Class field to the CI form, and update the class to the desired class
  2. Create a script that updates the sys_class_name field of the CI specified to the new class name

Other methods – mentioned below – do NOT work:
Continue reading…»

Asking for your opinion on integration solutions…

General No Comments »

Instead of telling you about a solution that we developed for a customer, this time I’m interested in getting your opinion on 3 possible integration solutions that give the same end-result, regarding:

  • ease of development
  • ease of maintenance
  • adherence to standards
  • out-of-the-box
  • ….

add your own considerations.
And maybe you have yet another solution.

Consider the following integration requirement:
– We want and external system to supply us with user – group relationship information, so that user management can be done outside of SNC
– With this interface user – group relationships can be created and removed (grant/revoke)We (sys_user_grmember)
– All inherited group roles should remain working

The chosen integration method

Continue reading…»

Activate a stuck workflow which “hangs” on activity timer

General 1 Comment »

In some situations it might occur that a workflow gets stuck. This is the case if the workflow is waiting for an action (or condition) that will never take place. Unfortunately there isn’t one generic solution for this as it could have been caused by several situations and with different workflow activities.
That’s why it can be quite painful to solve this kind of issues. However, there is some good news if the workflow “hangs” on an activity timer!

Read on, read on…..

Workflow timer activities are calculated and after that scheduled as a scheduled job. They are waiting to receive a trigger at a specific time so the workflow can “jump” to the next activity.
On our supportdesk we sometimes see that the scheduled jobs (which should perform the trigger action) are not available (anymore).

So in fact these workflows will wait forever!

Fortunately it isn’t that hard to start the workflow in these situations. What we need to do is create a new scheduled job for it, so the activity will be triggered again.

Let’s use an example of a change record that has a “stuck” timer activity in the workflow.
Continue reading…»

The Customer Update Indicator

General No Comments »

This is more of a reminder for functionality mentioned in the ServiceNow Wiki but that is easily forgotten about.

You might – just as I – have experienced the following in the past…..

You remember which object you modified but are not sure in which update set it ended up.
To address this ServiceNow provided a built-in feature, the ‘Customer Update Indicator‘. The feature is available with the Fall 2010 Stable 2 release.

You can check-up on this on the Wiki here: Embedded: Customer Update Indicator.

This small reminder-article might just help you in your everyday working with ServiceNow.

Creating Related Change without leaving the form

General 1 Comment »

Leaving isn’t necessarily good – except when you’re at the dentist maybe….
I’m sure most of you are familiar with the context action “Create Change” in the incident form.

This action will open a new form with a newly created change request and information from the originating incident populate the newly created change request.

Now there might be situations where you would like to stay on the incident form but still be able to create a new related change request.
For these situations you can create a new UI action and use the following sample information.
Continue reading…»

Building a custom script Search widget

General 6 Comments »

The flexible platform that ServiceNow is has more than once challenged my capabilities of analysis. Especially errors that occur during the development of complex functionalities for a customer can sometimes be challenging.

JSLint will occasionally throw warnings and other log statements that unbeknownst to the user are actually small coding mistakes. Making mistakes is a human characteristic, so this isn’t necessarily bad, but it would be a waste to not try and fix them.

org.mozilla.javascript.EcmaError: “security_admin” is not defined.
Caused by error in <refname> at line 1

==> 1: security_admin

The above warning is not killing the system, nor is it influencing the functionality. Tackling it could however improve performance or fix some unknown missing functionality. I’ve been tasked in the past with debugging assessments on multiple ServiceNow instances and felt the log was lacking in a method of quickly finding the culprit in statements like this. I therefore coded a little solution for this myself which consists of 3 separate parts:

  • Script include
  • UI page
  • Adding it to a widget (bonus)

I’ll explain the basics of the components in both scripts, and give a step-by-step guide through the script. As this was sort of a nifty challenge for me, I disregarded the way this can be done with Global Search as well by setting up a new search group. Also note that the widget will basically be able to dynamically create the search groups, based on the element types looking for. You should however consider this fact when implementing the update set.

Ok, let’s get started.

You can download a zip file containing an Update Set using the download button below.
[download id=”1″]
Continue reading…»

Sharing Sections across Forms

General No Comments »

If a customer uses a lot of different forms for one extended table (for instance cmdb_ci), it is possible to share sections across these forms.
The instructions below describe how to set this up.

Please remember: when you create an extended table, the layout of this table will be an exact copy of its parent. As long as you don’t change anything on the form layout, this will remain the case. By following the steps below, you force the system to create a separate instance for that form, so any modifications to the parent will not be propagated to the extensions anymore.

Step 1: Create table if needed.

Step 2: Create the section you need to share.
Do this at the highest level that contains all the attributes.
This is needed because the section will only be available for the extensions of the form where you created it.

Top left, in the Application Navigator header, type “” to get to the Configuration Item form.

Create a new Section (Personalize -> Form Layout) “CI Relationships”:

Add the CI Relations and Save the section:

(steps 2 and 3 are there to make sure your main section doesn’t disappear when executing this action)

Continue reading…»

How to reduce Server roundtrips during Client processing

General 2 Comments »

In this short article some useful information that allows for optimizing ServiceNow performance.

During catalogue processing it often happens that specific user-related-information must be displayed (e.g. Company, Phone, Cost Center, etc.).
This article describes a method for preventing unnecessary roundtrips to the Server when displaying this information on the Client.

By storing the most used information we might need later in the Session object, this data can be easily retrieved in a Client script.
The best moment for storing this data is during processing the session.established event.
The example below (click to enlarge) shows some customized data and normally would be replaced with data that is important for your personal instance.


Continue reading…»