java.lang.SecurityException: Method returned an object of type ComparisonCondition which is not allowed in scope "" Caused by error in sys_script_include...


Description

Getting error message, "Java.lang.SecurityException: Method returned an object of type ComparisonCondition which is not allowed in scope "<scope>" Caused by error in sys_script_include...". Could be when clicking a button and the ui action for the button calls the mentioned script include. Could be when doing other processes in your instance that calls a script include.

Cause

Check the script include and confirm it is using the correct structure, with the prototype portion as follows:


[code]<pre><code>var MyScript = Class.create();<br/>MyScript.prototype = {<br/>    initialize: function() {<br/>    },<br/><br/>    myMethod: function(sys_id) {<br/>        //function code<br/>    },<br/><br/>    type: 'MyScript'<br/>};<br/></code></pre>[/code]

Resolution

Update the script include to include the prototype line and to follow the default structure above.