CAD · Question #45
In a Business Rule, which one of the following returns the sys_id of the currently logged in user?
The correct answer is D. gs.getUserID(). This question asks for the correct method within a server-side Business Rule to retrieve the sys_id of the current user.
Question
In a Business Rule, which one of the following returns the sys_id of the currently logged in user?
Options
- Ag_form getUserID()
- Bg_form getUserSysy
- Cgs.getUserSysID()
- Dgs.getUserID()
How the community answered
(45 responses)- A7% (3)
- B2% (1)
- C2% (1)
- D89% (40)
Why each option
This question asks for the correct method within a server-side Business Rule to retrieve the sys_id of the current user.
`g_form` is a client-side API, not available in server-side Business Rules, and `getUserID()` on `g_form` typically returns the user's login ID, not sys_id.
`g_form` is a client-side API, not available in server-side Business Rules, and `getUserSysy` is not a valid method.
`gs.getUserSysID()` is not a standard GlideSystem method for retrieving the user's sys_id; `gs.getUserID()` serves this purpose.
In a server-side script like a Business Rule, `gs.getUserID()` is the correct GlideSystem method to return the sys_id of the currently logged-in user.
Concept tested: Server-side user identification (sys_id)
Source: https://docs.servicenow.com/bundle/utah-application-development/page/script/server-scripting/reference/r_GlideSystemAPI.html
Topics
Community Discussion
No community discussion yet for this question.