Using Built-In Java Functions in SSJS (and access them with typeahead:-)

Using Built-In Java Functions in SSJS (and access them with typeahead:-)

Sometimes it is worth to check out the functions of Vectors instead using Javascript Arrays..

Let’s take a look at the following case: I got a multivalue field and i would like to add on each save a value IN FRONT of the other values..
I do this like this:
QuerySave Event in a datasource:

var vWho:java.util.Vector = doc.getItemValue("HistWho")
vWho.add(0, @UserName()) //insert the actual username into the first position of the java vector
doc.replaceItemValue("HistWho", vWho)

Leave a Reply

comment-avatar

*