- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2024 03:45 AM
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.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2024 03:47 AM - edited 06-05-2024 03:48 AM
@Snow preck This is a self-invoking function. As it calls itself when the execution of the script field begins.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2024 03:48 AM
Hi @Snow preck
Self-invoking is correct.
Thanks
dgarad

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2024 03:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2024 04:29 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2024 03:47 AM - edited 06-05-2024 03:48 AM
@Snow preck This is a self-invoking function. As it calls itself when the execution of the script field begins.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2024 03:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2024 03:48 AM
Hi @Snow preck
Self-invoking is correct.
Thanks
dgarad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2024 04:29 AM
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.