Hi All,
I’ve just added a computed field to a form which concatenates the values from 15 fields (all of which may or may not contain a date value stored as a string - bad design, I know, but it’s what I’m working with) into a list, runs @Transform on all of the values to remove them if they are blank, or convert them to a datetime value if they are not, then it sorts the remaining values to return the most recent date from the list. Here is the formula:
var:=ActionDate_1:ActionDate_2:ActionDate_3:ActionDate_4:ActionDate_5:ActionDate_6:ActionDate_7:ActionDate_8:ActionDate_9:ActionDate_10:ActionDate_11:ActionDate_12:ActionDate_13:ActionDate_14:ActionDate_15;
var:=@Transform(var;“tempVar”;@If(tempVar=“”;@Nothing;@ToTime(tempVar)));
var:=@If(@Elements(var)=1;var;@Sort(var;[DESCENDING]));
@If(@Elements(var)=1;var;var[1]);
This formula works fine in the field, but I now I want to display the result in a view and I didn’t want to have to refresh all of the documents in the database because there are a lot of documents in there. I thought it would be easier to just use the same formula in my view column if the LastContactDate field doesn’t exist. However, it seems that something is different in how Domino deals with column formulas, because the EXACT SAME formula in the column returns ‘Incorrect data type for operator or @Function: Number expected’, before I’ve even bothered to check for a value in LastContactDate first. I’ve verified that the LastContactDate computed field gets populated correctly when I do refresh the document, but in the view, the formula returns the number expected error. I’ve also tested the formula in an action and it works fine there as well. It is fine in the view if all 15 date fields are populated, or if none of the fields are populated, but if some of them have values and some of them are blank, it falls over with the error.
Has anyone got any suggestions as to what might be going on here?
I’m developing in 6.5.5, and I’ve tested this on a 7.0.2 server and a 6.5.1 server with the same result.
Emily.