- 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
‎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
‎05-23-2018 11:03 AM
Awesome, hopefully OP marks question answered if this solves for them.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2018 11:54 AM
It worked!!! Thank you, thank you, thank you!!!
I love the ServiceNow Community!