Understanding and using inheritance in Script include

A few days ago I saw a question on the ServiceNow community about how inheritance works in a script include so I thought to write a short article about that.

In Script include we can write a function or we can create a class. In JavaScript, class is an object, an object can access properties and functions from another object, this we call Inheritance

Inheritance is a great way to create a parent/child hierarchy of classes. A good use case for inheritance is when you wish to indicate that one object is mostly similar to another, but with some variations.

Continue reading →

How to generate Assessment using AssessmentCreation API?

In some scenarios, we want to be able to generate on-demand assessments, that can be Service Portal or UI Action or Business rule

ServiceNow AssessmentCreation API provides a way to generate assessments via script. In the article, I am using createAssessments method to generate assessments via Service Portal Widget

first here is a quick explanation of the method parameter

AssessmentCreation.createAssessments (String typeID, // Assessment Metric Type Sys ID
 String sourceRecordID, // Assessable Record which will be the source of assessment
String userID // users ID to which to send assessment instances to
)
Continue reading →

How to apply IRE to import sets?

Using import set for populating CMDB is always a challenging activity. setting up the right coalesce field to your transform map makes this activity particularly challenging, correctly identify CI primary attribute is a key to reduce the risk of introducing inconsistencies through duplicate records.

Identification and Reconciliation(IRE) framework provides JavaScript API that can be used in import set. by using CMDBTransformUtil class, you don’t need to set coalesce field in your transform map. CMDBTransformUtil class uses Identification rules that already exist to workout what should the primary key for this import.

Continue reading →

AJAX again

Hello Friends

Today I am writing again about AJAX – I actually wrote back in 2014 a blog post about this very same topic but it seems that I really like this topic so I thought to write about it again.

before getting into the weeds, quick recap of two concepts

Synchronous is real-time communication method where each party receives messages instantly and requestor needs to wait for the request to be complete.

Asynchronous  is a communication method of exchanging messages between parties in which each party receives and processes messages whenever it’s possible to do so, rather than doing so immediately upon receipt. requestor immediately continues with its work without caring for the immediate result.

When to use GlideAjax ?

Continue reading →