Function trim() Not Supported in PAM 4.x

Document created by yeola02 Employee on Jul 21, 2015
Version 1Show Document
  • View in full screen mode

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).

 

The alternative is to use this instead:

 

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

 

For example:

 

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

2 people found this helpful

Attachments

    Outcomes