Set value of multivalue field

In LS what is the simplest way to set the value of a multivalue field. I am currently using this method:

Dim vApprName( 1 To 2 ) As String

vApprName( 1 ) = “John Doe”

vApprName( 2 ) = “Jane A Test”

newdoc.ApprName = vApprName

In formula language, I know you can do it like this:

ApprName:=“John Doe”:“Jane A Test”;

Is there a similar way in script?

Subject: Set value of multivalue field

  1. Why are you doing it with LS as oppossed to Formula Language?2) What’s wrong with your current method?

LS is typically more complex than formulas.

Subject: RE: Set value of multivalue field

There is much more to the agent than just this. I am stepping through a view and creating documents based on the value of another mult-value field in each document.

I have several multivalue fields that need to get populated and it seems that there should be a simpler way to do it.

Subject: RE: Set value of multivalue field

I guess it really all depends on where you are getting the data from. Without more detail I really couldn’t say what is the easiest and best approach.

Subject: Set value of multivalue field

I’ve use this technique if I want to quickly assign something to an array.

Dim tmpList as String

Dim varList as Variant

tmpList = “A,B,C,D,E”

varList = split( tmpList, “,” )

Subject: RE: Set value of multivalue field

Of course, it also depends where the data are coming from that goes into the field. There might be a way to retrieve the value already as an array.