Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2024 06:13 AM
Adding some temporary logs to see if the script is running, and how far it is getting.
var LocationUtils = Class.create();
LocationUtils.prototype = Object.extendsObject(AbstractAjaxProcessor, {
// This function is callable from the client script
getLocationDetails: function() {
gs.addInfoMessage('Script Include running')
var locationId = this.getParameter('sysparm_location_id'); // Get the location sys_id
gs.addInfoMessage('Location = ' + locationId)
var locationGr = new GlideRecord('cmn_location');
if (locationGr.get(locationId)) {
gs.addInfoMessage('Location record found')
// Create an object to hold the results
var result = {
assignment_group: locationGr.u_assignment_group, // Adjust field name as necessary
assigned_to: locationGr.u_location_support // Adjust field name as necessary
};
gs.addInfoMessage('Result = ' + JSON.stringify(result))
return JSON.stringify(result); // Return the result as a JSON string
}
gs.addInfoMessage('Location record not found')
return 'location not found'; // Return if not found
},
type: 'LocationUtils'
});
Which of these messages are you seeing when you change Service Offering to ACD or Call Center after ensuring the Location field is populated?