- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2018 07:05 PM
I have a simple script include function that I want to test from script background. I tried the scripts below, but it doesnt seem to be doing anything.
Script background (to call function - "eventMessage"):
var update = new UpdateTask();
UpdateTask.eventMessage('sc_task','7','request_item.number','RITM0000001');
Script Include (has the function"eventMessage" which updates sc_task table's State field):
var UpdateTask = Class.create();
UpdateTask.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {
eventMessage:function(eventTable,eventState,eventField1Name,eventField1Value){
var rec = new GlideRecord(eventTable); //name of the Task table to be updated
rec.addQuery(eventField1Name,eventField1Value);
rec.query();
while(rec.next()) {
if(eventState){
rec.state = eventState; //Status value 7: Close-Skipped
rec.update();
}
}
},
type: 'UpdateTask'
});
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2018 07:32 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2018 07:32 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2018 07:49 PM
Thank you Jon!
I spot the mistake I was making 🙂
Thank you again,
Yogesh