The canDisableRL() function in the script include 'MajorIssueManagementImpl' is causing slowness in sn_customerservice_case table Templates.DescriptionThere is a OOB ACL on table "sn_customerservice_case.recipient_list(sys_id: 49e476213bd61300b4e64d72f3efc490)" which calls the canDisableRL() function in the script include 'MajorIssueManagementImpl'. This script is doing glide record query of the sys_id of the parent of each case record. But in some cases, the parent is empty. When there are thousands of records with parent is empty, the rendering is very slow. This slowness can be encountered in sys_template on 'sn_customerservice_case' table.Steps to Reproduce 1)Install the plugin 'Major Issue Management( com.sn_majorissue_mgt)'. This plugin will download the above mentioned script include and the ACL.2)Create a template in sys_template table for the 'sn_customerservice_case' table with any value.3)Create multiple records in Case table using a background script. Example:var gr = new GlideRecord("sn_customerservice_case");for(var i = 0; i <= 3000 ; i++){gr.short_description = "test";gr.insert();}4)Again, open the created template. Notice that Template field keeps loading for few secs. In my test instance, I had about 3000 records and it took 1.5 s to complete the request. In customer instance, they have above 2 million records which made the browser freeze.In the canDisableRL() of the script include, if there is a check to see if the records has Parent field non-empty, the issue is resolved.For example changed the script from:canDisableRL:function(){var cGr=new GlideRecord(this.ATTR_TABLE_NAME);cGr.addQuery(this.ATTR_PARENT, this._gr.sys_id);cGr.query();while(cGr.next()){if(cGr.getValue(this.ATTR_AUTO_CREATED_BY) == true){return true;}}return false;},TO:canDisableRL:function(){if(this._gr.sys_id){var cGr=new GlideRecord(this.ATTR_TABLE_NAME);cGr.addQuery(this.ATTR_PARENT, this._gr.sys_id);cGr.query();while(cGr.next()){if(cGr.getValue(this.ATTR_AUTO_CREATED_BY) == true){return true;}}}return false;}, OR TO: canDisableRL:function(){ if( gs.nil(this._gr) || !this._gr.isValidRecord() ) return false; var cGr=new GlideRecord(this.ATTR_TABLE_NAME); cGr.addQuery(this.ATTR_PARENT, this._gr.sys_id); cGr.addQuery(this.ATTR_AUTO_CREATED_BY, true); cGr.query(); if (cGr.hasNext()) return true; return false; },WorkaroundAn upgrade is recommended to get the latest version. If you cannot upgrade, you can refer to the following workaorund: In the canDisableRL() of the script include, if there is a check to see if the records has Parent field non-empty, the issue is resolved.For example changed the script from:canDisableRL:function(){var cGr=new GlideRecord(this.ATTR_TABLE_NAME);cGr.addQuery(this.ATTR_PARENT, this._gr.sys_id);cGr.query();while(cGr.next()){if(cGr.getValue(this.ATTR_AUTO_CREATED_BY) == true){return true;}}return false;},TO:canDisableRL:function(){if(this._gr.sys_id){var cGr=new GlideRecord(this.ATTR_TABLE_NAME);cGr.addQuery(this.ATTR_PARENT, this._gr.sys_id);cGr.query();while(cGr.next()){if(cGr.getValue(this.ATTR_AUTO_CREATED_BY) == true){return true;}}}return false;}, OR TO: canDisableRL:function(){ if( gs.nil(this._gr) || !this._gr.isValidRecord() ) return false; var cGr=new GlideRecord(this.ATTR_TABLE_NAME); cGr.addQuery(this.ATTR_PARENT, this._gr.sys_id); cGr.addQuery(this.ATTR_AUTO_CREATED_BY, true); cGr.query(); if (cGr.hasNext()) return true; return false; },Related Problem: PRB1345233