indexOf is not a function error in recorde producer.

Sanjeev Kumar1
Kilo Sage

Hi All,

 

I have used javaScript function "indexOf() " in record produces fulfillment script.

When I run it in Background Script it is working. When I am using same in fulfillment Script.

I am getting following Error "indexOf is not a function ".

1 ACCEPTED SOLUTION

Sanjeev Kumar1
Kilo Sage

Hi All,



Now problem has been fixed.


If you get such error you should use javaScript String() function.



var n = String(strToSystemName).indexOf('.');




Now it will work.


View solution in original post

4 REPLIES 4

Bhavesh Jain1
Giga Guru

Try this :


var code = indexOf('....');


var output = eval(code);


Hi,


It's Not working even I have try str.split("."); function.


this function also giving me same error "split is not a function" with record producer .


Please post your script in this thread.   There may be a different error causing this.


Sanjeev Kumar1
Kilo Sage

Hi All,



Now problem has been fixed.


If you get such error you should use javaScript String() function.



var n = String(strToSystemName).indexOf('.');




Now it will work.