Function trim() Error in PAM 4.x

Document ID : KB000031306
Last Modified Date : 14/02/2018
Show Technical Document Details

Issue:

The JS engine PAM 4.x uses does not support trim(). If you attempt to use it in a javascript code in a PAM Run Javascript Operator, it will result in an error similar to this:

--TypeError: Cannot find function trim. (#16)


Environment:  

PAM 4.x
Windows OS, UNIX, Linux

 

Workaround:

The alternative is to use this instead:

.replace(/^\s+|\s+$/gm,'')

Example:

var trimmedTitle = Process.theTitle.replace(/^\s+|\s+$/gm,'');