Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

What is the purpose of 'type' in script includes?

Slava Savitsky
Giga Sage

When you create a new script include, the system automatically adds some code to the Script field as soon as you give your script include a name. The second line from the bottom looks like this:

type: 'your_script_include_name'

What is the purpose of this 'type'? What is the impact of leaving this line out? I can see that many out-of-box script includes do not have it. Thanks.

1 ACCEPTED SOLUTION

andrew_venables
ServiceNow Employee

It allows you to call obj.type and find out what type the object is 🙂



Leaving it out on new Script Includes shouldn't have an impact unless you write code that expects it


View solution in original post

3 REPLIES 3

Kalaiarasan Pus
Giga Sage

Maybe the answer lies in 'prototype' ....


andrew_venables
ServiceNow Employee

It allows you to call obj.type and find out what type the object is 🙂



Leaving it out on new Script Includes shouldn't have an impact unless you write code that expects it


Thanks, Andrew. I knew I was missing something very simple.