- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2017 12:05 PM
I'm in the process of refactoring our CTI processing for Istanbul per HI KB0620953 "Ensure a working CTI Integration in preparation for an Istanbul upgrade". The big change is that any inserts, updates or deletes must be performed from a non-client callable script in sys_script (business rules table) while the rest of the CTI processing is in a client callable script in sys_script. The problem I'm having is that the client callable script is getting a 'function not found' error when calling the non-client callable script. Here's the client callable script:
function cti() {
var empNbr = sysparm_caller_id;
var url = 'nav_to.do?uri=new_call.do';
if (empNbr != null && empNbr != '') {
var user = new GlideRecord('sys_user');
user.addQuery('employee_number', empNbr);
user.query();
if (user.next()) {
// it's this statement that fails with function not found
var callSysId = u_CTI_Create_Call(user.sys_id, user.employee_number, user.u_lan_id); // not client-callable per release notes
if (callSysId != null) {
url += '?sys_id=' + callSysId; // set url to open the just created call record
}
}
}
answer = url; return url;
}
The u_CTI_Create_Call is defined as a non-client callable business service on the Global table and is active.
What am I doing wrong?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2017 03:32 PM
I had opened up a HI incident on this issue and just heard back that KB0620953 as well as the comments in the OOTB CTI Processing business rule are in error - the non-client callable function that must be factored out should be a script include and not a global buisness rule (sys_script entry).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2017 12:40 PM
Have you tried it with new before the script name:
var callSysId = new u_CTI_Create_Call(user.sys_id, user.employee_number, user.u_lan_id); // not client-callable per release notes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2017 01:45 PM
Jochen,
Thanks for the suggestion. I hadn't tried adding new. I modified the call to include it but got the same error - 'u_CTI_Create_Call' is not defined.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2017 03:32 PM
I had opened up a HI incident on this issue and just heard back that KB0620953 as well as the comments in the OOTB CTI Processing business rule are in error - the non-client callable function that must be factored out should be a script include and not a global buisness rule (sys_script entry).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2017 04:00 AM
Steve,
Did you actually get this working?
I'm doing something similar. I have my client callable script as a global business rule that calls my non-client callable script include.
The script include (in table sys_script_include) does not do the insert. The script include is in the global scope and is not client callable.
Example:
var CTIUtils = Class.create();
CTIUtils.prototype = {
initialize: function() {
},
createNewCall:function(userId) {
var nCall = new GlideRecord('new_call');
nCall.initialize();
nCall.caller = userId;
nCall.insert();
return nCall.getUniqueValue();
// I also tried this code commented out below to create a new incident, but that doesn't work either.
//var iGr = new GlideRecord('incident');
//iGr.initialize();
//iGr.caller_id = userId;
//iGr.insert();
//return iGr.getUniqueValue();
},
type: 'CTIUtils'
};
Can you post some sample code?
Edit: I found more info the Node File Browser
It looks like even though the script include is not-client callable, the code is still run in the SandBox
"WARNING *** WARNING *** Security restricted: User tried to run insert in GlideRecordSandbox"
Arren