Split() not working in scoped business rule.

Tommy Jensen
Giga Guru

I have a business rule that runs in an application scope and the following fails when run in an application scope

var text = 'abc, def':

var temp = text.split(',');

however it works when running in global scope.

How do I call the split() function in an application scope?

1 ACCEPTED SOLUTION

Tommy Jensen
Giga Guru

Solved.



Adding a toString() before split() solved the issue. But strange this is necesary only when the rule runs in an application scope. The exact same rule worked fine in global scope without the extra toString()


View solution in original post

3 REPLIES 3

Gurpreet07
Mega Sage

If you copied the code then there's a spelling mistake


var text = 'abc, def':


var temp = text.spli(',');


No spelling error in the code.


Tommy Jensen
Giga Guru

Solved.



Adding a toString() before split() solved the issue. But strange this is necesary only when the rule runs in an application scope. The exact same rule worked fine in global scope without the extra toString()