Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

Need to pass script include function into BR

ABC6
Tera Contributor

Hi Team,
I have a requirement where i need to call the script include from business rule ,
Not wroking ,Please help me to get this issue resolved

ABC6_0-1706113173959.pngABC6_1-1706113330955.png

 

1 ACCEPTED SOLUTION

Narsing1
Mega Sage

Modify the script include Line 7 like this

var obj = {};

Business rule

if (JSUtil.nil(errStatus)) {
var b = new newPropValue().base_class();
	if (b.indexOf(current.sys_class_name.toString()) == -1) {
		//your code
}

 

Thanks,

Narsing

View solution in original post

2 REPLIES 2

Narsing1
Mega Sage

Modify the script include Line 7 like this

var obj = {};

Business rule

if (JSUtil.nil(errStatus)) {
var b = new newPropValue().base_class();
	if (b.indexOf(current.sys_class_name.toString()) == -1) {
		//your code
}

 

Thanks,

Narsing

Community Alums
Not applicable

Hi @ABC6 ,

Hi @ABC6 ,

Refer example below

Script Include:

var MyScriptInclude = Class.create();
MyScriptInclude.prototype = {
    initialize: function() {
    },

	myFunction: function(){
		
		gs.info('Script Include called');
		
	},
	
    type: 'MyScriptInclude'
};

How to call from BR:

new MyScriptInclude().myFunction();