- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2018 10:22 AM
Service Portal newbie, I am. I'm attempting to use a Requests menu item in the header for a scoped app. I pulled it from the SP_Header menu. I was able to solve the issue of $sp not working in a scoped app (found some code online here that worked!) but now I am getting an error message that getGlideObject() is not a scoped API. I saw one post that you have to use the scoped API GlideDate or GlideDateTime but I have no idea how to script it, or replace the existing line of code that contains getGlideObject(). Has anyone edited that script in the SP_Header menu for Requests to get it to work in a scoped app? Same with the widget... no luck there either. Thanks in advance!
Solved! Go to Solution.
- Labels:
-
Service Portal Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2018 09:24 AM
I was able to resolve this by changing:
a.sortOrder = z.sys_created_on.getGlideObject().getNumericValue();
to:
var gdt = new GlideDateTime(a.sys_created_on);
a.sortOrder = gdt.getNumericValue();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2018 10:24 AM
The title is someone misleading... not dealing with the my Requests widget... but the menu item.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2018 01:57 PM
Can you be more specific. What did you try, how did it fail, what are you trying to accomplish?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2018 06:39 AM
I have a scoped app that I am building a Service Portal, "ITDAS".
I created an ITD Header Menu based on the SP Header Menu (OOB).
I attempted to add the "Requests" Menu Item, based on the item of the same name in SP Header Menu. I copied the Server Script and Condition from that SP Header Menu Item "Requests".
When I attempt to load the page, the first error message was $sp not defined. I was able to substitute some code I found online that worked for that error (shown in this snippet).
Now I am getting the error message: Function getGlideObject is not allowed in scope x_itdas.
Here is the snippet of code that contains getGlideObject
Thanks for looking at it!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2018 06:41 AM
I want the Requests item to appear in the header menu, with a drop-down view of that customer's requests. (what I'm trying to accomplish). Thanks again.