Loading a mutivalue field

Hello,

I have a form with 25 date fields.

I have another mutivalue date field that I am attemting to load with the 25 individual dates.

I gave the mutivalue date field the following value:

vac_1:vac_2:vac_3…

This works fine as long as all the individual dates have values in them, but fails when any one of them is empty.(ERROR: Incorrect data type for operator or @Function: Time/Date expected)

How would I solve this.

Thanks.

Subject: Loading a mutivalue field

Make the mutlivalue field a text list that can contain an empty string.

Then

tmpField1:=DatesField[0];

@if(tmpField1=“”;“”;@TextToTime(tmpField1)

or better yet, make a button or postmodechange event that does something like this (typed on the fly and not tested):

@For(n := 1; n <= @Elements(DatesField); n := n + 1;

tmpFieldName:=“Vac-”+@Text(n)];

@If(n!=“”;@setField(tmpFieldName;@TexToTime(n));

“”))

Subject: RE: Loading a mutivalue field

  1. You slipped into LS there; arrays are 1-based in Formula, not 0-based, so DatesField[0] would throw an error.

  2. I think you read his question backwards of the way I did; you seem to be giving him a way to fill the 25 individual fields from the list field, while he’s asking to fill the list from the 25 single-value fields.

If the 25 fields all have the same name except for a numeral suffix, you could use a multi-value CFD text field with the formula

@for(n := 1; n <= 25; n := n + 1;

DatesField := @trim(DatesField : @text(@getfield(“Date” + n))))

If the fieldnames can’t be systematically generated in code that way, you’ll have to use

DatesField := @trim(@Text(Field1) : @text(Field2) : … : @text(Field25))