Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
Global Search | MethodNotAllowedException: Function getUser is not allowed in scope sn_global_searchui - Known Error
  • >
  • Knowledge Base
  • >
  • Known Error (Knowledge Base)
  • >
  • Global Search | MethodNotAllowedException: Function getUser is not allowed in scope sn_global_searchui
KB0656086

Global Search | MethodNotAllowedException: Function getUser is not allowed in scope sn_global_searchui


3572 Views Last updated : Apr 7, 2024 public Copy Permalink
KB Summary by Now Assist

Description

Build name: Jakarta
Build date: 08-15-2017_2030
Build tag: glide-jakarta-05-03-2017

Reported under: INT3379041

The customer is attempting to use functionality they used previously and are getting the following error from SearchMetadata:

source:Evaluator
com.glide.script.fencing.MethodNotAllowedException: Function getUser is not allowed in scope sn_global_searchui
Caused by error in sys_script_include.05b0c68867732200b133956c33415a9e.script at line 5

Steps to Reproduce

 

  1. Test using global search UI on the Jakarta branch
  2. Navigate to search group Knowledge & Catalog
  3. Select search table sc_cat_item
  4. Add new condition:

    field = Created By
    operation = contains
    value = javascript: gs.getUser()
  5. Perform global search for anything

    The message Function getUser is not allowed in scope sn_global_searchui displayed either on the global search UI page or on the resulting page after a link in results is clicked.

Workaround

Instead of gs.getUser(), use gs.getUserID(), which returns the sys_id of the current user.

There may be other cases where filters that are allowed out-of-scope are not allowed in-scope. Converting those to use scope-safe methods is the appropriate resolution in those cases as well.


Related Problem: PRB1151412

The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.