Business Rules run server-side, so the correct APIs come from the GlideSystem object (gs) rather than client-side objects like g_form. In server-side scripting, the platform provides a standard way to retrieve the currently logged-in user’s identity. The method gs.getUserID() returns the sys_id of the user associated with the current session. This is commonly used in Business Rules for auditing logic, conditional processing, field stamping (for example, setting a custom “last processed by” field), or enforcing business rules based on user identity. The g_form object is a client-side API available in Client Scripts and UI Policies, so any option using g_form is invalid in a Business Rule context. Likewise, gs.getUserSysID() is not the documented method name for this purpose. Using the correct server-side API ensures the script executes reliably regardless of UI context (classic UI, workspace, mobile), because it relies on the session and not on the form rendering layer.
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit