I’ve searched the forum for similar problems and found quite a bit on the evaluate + @dbcolumn and the LS equivelant of @Max but still can’t get my code to work.
I’m trying to do a counter in the Querysave event that sets a unique number in the Phone-field, but need to do it in LS since the Continue flag doesn’t exist in Formula and I have to be able to halt the save if some conditions aren’t met.
Sub Querysave(Source As Notesuidocument, Continue As Variant)
Dim NL As Variant
Dim NLMax As Integer
Dim NT As Integer
NL = Evaluate({@DbColumn(“”;“”:“”;“($Num)”;1)})
NLMax = Evaluate({@Max(@Tonumber(NL))})
NT = NLMax+1
Call source.fieldSetText (“Phone”,Cstr(NT))
End Sub
All I want to do is to check for the highest number in a column and set a field to the next number. I haven’t gotten to the @isnewdoc check yet since I got stuck on Evaluate.