Scripting Module 2 Flashcards

1
Q

What is a client script?

A

Manage the behavoir of forms, fields and lists in real time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

When does an onLoad client script run?

A

script runs when a form loads and before control is given to the user

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

When does a onSubmit client script run?

A

Script runs when a form is save or submitted

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

When does a onChange client script run?

A

Script runs when a particular field value changes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What parameters does the onChange client script have?

A

control
oldValue
newValue
isLoading
isTemplate

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

When does a onCellEdit client script run

A

Script runs when a field is edited from a list view

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What parameters does the onCellEdit client script have?

A

sysIDs
table
oldValues
newVlaue
callback

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the most popular client side API’s

A

g_form
g_user
g_scratchpad

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are common used g_form methods?

A

flash()
showFieldMsg()
getValue()
setValue()
clearValue()
addOption()
clearOption()
getSections()
isNewRecord()
addFormMessage()
clearAllFormMessages()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does g_form.getValue() do?

A

Retrieves a field value from the form. Always returns as string
Text field - returns the content
Choice list - returns the value not the label
Reference - returns the sys_id

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the g_user properties?

A

firstName
lastName
userID
username

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

what are the g_user methods?

A

getClientData()
getFullName()
hasRole()
hasRoleExactly()
hasRoleFromList()
hasRoles()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What script debugging strategies are available?

A

ServiceNow built in debugging tools
–script debug messages (addInfoMessage and addErrorMessage())
–JavaScript Log and jslog()
–Response Time Indicator
Javascript debugging tools
–alert()
–try/catch
Browser tools (javascript console, web console
Third party tools

How well did you know this?
1
Not at all
2
3
4
5
Perfectly