I am a Java programmer and very new to Formula Language so I am struggling a bit. This code selects a quote number from the top of a column then adds 1 to it to produce a new quote number. The problem is that the numbers have gone all haywire after it reached 228, this year and last year, so now it is really a hashup! I would rather have it select the highest number in the column and add 1 to it. The field is a text field and the result it currently receives is: W09-9D which should be: W09-229D. W = Wynleigh, 09 = year; 229 = Quote number; D = Location.
Any idea Why it dislikes W09-229D??
Looking forward to your expertise.
SRV:= @Subset(@DbName; 1);
DB:= @Subset(@DbName; -1);
VIEW:= "Quote Sequence";
VAL := @Subset( @DbColumn("":"NoCache"; SRV: DB; VIEW; 1);1);
NXTVAL := @TextToNumber(@Right( VAL; "-")) + 1;
LOCATION := @If(
@Contains(SRV; "OnTheBeach"); "D";
@Contains(SRV; "Team"); "J";
"L"+ @Left(@Right(@Name([CN]; @UserName); " "); 1));
TXTVAL := "W" + @Right(@Text(@Year(@Today)); 2) + "-" + @Text(NXTVAL) + LOCATION;