- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2016 09:27 AM
Hi guys I am encountering the below error when creating a new record.
The code below would update the Number of Requests on the Header Menu whenever a record is saved (current user):
The code is located in Service Portal Menu header-> Menu Items. Type = Scripted List.
var st = new GlideRecord('myTable');
if (st.isValid()) {
st.addActiveQuery();
st.addQuery('opened_by', gs.getUserID());
st.orderByDesc('sys_updated_on');
st.setLimit(max);
st.query();
while (st.next()) {
var a = {};
$sp.getRecordValues(a, st, 'request_description,sys_id,number,sys_updated_on'); This is where the error is occuring
if (st.request_description.nil())
// a.short_description = st.request_description;
a.__table = st.getTableName();
a.type = 'record';
// a.sortOrder = st.sys_updated_on.getGlideObject().getNumericValue();
t.items.push(a);
}
}
This code works perfectly for the Incident table. But for some reason is not working in my custom table. Any idea why?
Solved! Go to Solution.
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2016 11:29 AM
No fix. An evangelist told me to open a HI ticket with ServiceNow.
I know this doesn't solve your problem, but it's a start.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2016 10:08 AM
Is the custom table part of a scoped application? If so, the global getRecordValues method may not be accessible inside a scoped app. I have run into this with a scoped app before where the global applyTemplate method was inaccessible.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2016 11:23 AM
Hey Chris yep it is a scoped app. Any way to fix this? Cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2016 11:29 AM
No fix. An evangelist told me to open a HI ticket with ServiceNow.
I know this doesn't solve your problem, but it's a start.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2016 12:11 PM
Thanks Chris appreciate it.