Class functions from script include are not getting called in Lab platform
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2025 08:11 PM
I copied code from labs exactly and did multiple labs, but could never get a call to class function working in lab instance. If I change it to function code only , it works. Below is a snippet of code.
Now able to call class function in business rule and client script. I have made sure that I copy code exactly from the lab work.
Script:
-------
var AssignmentGroupUtils = Class.create();
AssignmentGroupUtils.prototype = Object.extendsObject(AbstractAjaxProcessor, {
countGroupMembers: function() {
var grpName = "";
var message = "There are no members in this Assignment Group";
var groupID = this.getParameter('sysparm_group_id');
var grpMems = new GlideRecord('sys_user_grmember');
grpMems.addQuery('group.sys_id', groupID);
grpMems.query();
if (grpMems.next()) {
grpName = grpMems.getDisplayValue('group');
} //close if
if (grpName != "") {
message = "There are " + grpMems.getRowCount() + " members in the " + grpName + " group";
} //close if
return message;
},
type: 'AssignmentGroupUtils'
});