Guess this?

Snow preck
Tera Contributor

precilaK_0-1717584218837.png

This type of JavaScript function is known as:
A. Constructor

B. Scoped

C. Anonymous

D. Self-invoking

 

I feel Self-invoking correct, Please correct if I am wrong.

4 ACCEPTED SOLUTIONS

Sandeep Rajput
Tera Patron
Tera Patron

@Snow preck This is a self-invoking function. As it calls itself when the execution of the script field begins. 

View solution in original post

dgarad
Giga Sage

Hi @Snow preck  

Self-invoking is correct.

If my answer finds you well, helpful, and related to the question asked. Please mark it as correct and helpful.

Thanks
dgarad

View solution in original post

@Snow preck Please accept the response as a solution if I addressed your question. 

View solution in original post

SN_Learn
Kilo Patron
Kilo Patron

Correct answer is self-invoking

 

Developers write their code inside the executeRule function. The current and previous objects are automatically passed to the executeRule function.

The function syntax is known in JavaScript as a self-invoking function or an Immediately Invoked Function Expression (IIFE). The function is immediately invoked after it is defined. ServiceNow manages the function and when it is invoked; developers do not explicitly call Business Rule scripts.

 

ServiceNow reference Document: Self Invoking function 

 

Please hit like and mark my response as correct if that helps.

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.

View solution in original post

4 REPLIES 4

Sandeep Rajput
Tera Patron
Tera Patron

@Snow preck This is a self-invoking function. As it calls itself when the execution of the script field begins. 

@Snow preck Please accept the response as a solution if I addressed your question. 

dgarad
Giga Sage

Hi @Snow preck  

Self-invoking is correct.

If my answer finds you well, helpful, and related to the question asked. Please mark it as correct and helpful.

Thanks
dgarad

SN_Learn
Kilo Patron
Kilo Patron

Correct answer is self-invoking

 

Developers write their code inside the executeRule function. The current and previous objects are automatically passed to the executeRule function.

The function syntax is known in JavaScript as a self-invoking function or an Immediately Invoked Function Expression (IIFE). The function is immediately invoked after it is defined. ServiceNow manages the function and when it is invoked; developers do not explicitly call Business Rule scripts.

 

ServiceNow reference Document: Self Invoking function 

 

Please hit like and mark my response as correct if that helps.

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.