- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2015 08:07 AM
Hi,
Can aynone help me out in identifying the error in the following code? My expectation is function should return value , but it is returning value
var IreturnInc = Class.create();
IreturnInc.prototype = Object.extendsObject(AbstractAjaxProcessor, {
IreturnInc : function()
{
var incref = new GlideRecord('incident');
incref.query();
if(incref.next())
return incref.number;
},
type: 'IreturnInc'
});
Please help.
Regards,
Anil Karamsetty
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2015 05:06 AM
Thanks All for your Coordination. Code is working now. but surprisingly i did not make any changes to the code , i copied the code from my post and pasted in demo instance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2015 12:20 AM
Hi Travis,
I tried with the first option that you have mentioned. but i did not see any change in the result.
also , i do not know where i should check in service now , after capturing the log with console.log(response.responseXML); could you please help me in identifying the navigation so that i will go ahead and capture the log.
Regards,
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2015 12:45 AM
Can you please update the below code and check in logs(System logs--->>All-->>search for Message contains Inside if incident number)
var IreturnInc = Class.create();
IreturnInc.prototype = Object.extendsObject(AbstractAjaxProcessor, {
IreturnInc : function()
{
var incref = new GlideRecord('incident');
incref.query();
if(incref.next())
{
gs.log('Inside if incident number:'+incref.number);
return incref.number;
}
},
type: 'IreturnInc'
});

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2015 02:10 AM
actually what are you trying to do ? This would query the entire incident table? Is that what you want to do ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2015 02:16 AM
Hi Kalai,
I am learning Script Includes.So i wrote one sample program that would query Incident table and takes one incident and passes to client side script that would display when incident table loads.
I executed the same script include in Background script. it prompted me correct value. but it is not working when i wrote the same code in script include and client side script.
Regards,
Anil Kumar Karamsetty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2015 02:18 AM
Client callable is checked ? Can you share the client script?
Visited this page?
http://wiki.servicenow.com/index.php?title=GlideAjax