celso.mattheus's picture

I've been recently experimenting and learning with writing scripts for Aris, and I've hit a wall with this one. 

My problems is this, I'm trying to compare a list of models that I extract with a report. To compare their names in an easier way, I was trying to simplify their names (all lower cases and substitute every white space with underlines). I'm having a hard time with this last transformation. I've tried to use the "replace()" function, but an error message is shown when I do it. 

The snippet of code that I was using to simplify the names of the models is:

var model = oObjOccList[0].Model();
var modelExtract2 = model.Name(idioma);
var modelExtract = modelExtract2.replace(/\s/g, "_")
var modelName = modelExtract.toLowerCase();

 

When I try to run it, it gives me:

"The choice of Java constructor replace matching JavaScript argument types (function, string) is ambiguous; candidate constructors are:
class java.lang.String replace(char, char)
class java.lang.String replace(java.lang.CharSequence, java.lang.CharSequence)"

 

What gives?