I am new to Domino designer and lotus script,
following my second question,
I have some issue in setting unique ID (for id field in form).
My formula for Id field value :
T_List:=@DbColumn("" : "NoCache"; "Local"; "DBintro";"testview"; 1); @If(@IsNewDoc & @Elements(T_List)=0;1;@IsNewDoc & !@IsError(T_List);@Subset(T_List;1) + 1;id)
I'm having DB in local (nothing shared).
referred this link an Answer by AndrewB
Server : Local
DBname : DBintro
view name : testview id - field in the form (which is set when required to save in DB)
Error I'm getting
Field id ! does not exist
Please help me to get out of this.. Thanks
EDIT :1 Updated code
T_List:=@DbColumn("" : "NoCache"; "Local"; "DBintro";"testview"; 1);
T_List:=@Sort(T_List; [DESCENDING]);
@if(@Iserror(T_List);
1;
@Subset(T_List;1)+1
);
Perhaps re-arranging the logic might help - try this in the formula for Id field. Make the field "Computed When Composed" (next to field typer in properties box - it means it only evaluates when the doc is first created, and remains the same after - saves detecting @IsNewDoc :-D ):
You don't have to worry about the id field returning itself if the doc isn't new, because the computed when composed field stops evaluating after 1st save.
Bad formula for your dbColumn. There should be a colon, not semi-colon between servername and filename. Of course, there is no server named "Local". You would just use "" for local. Also, the filename is the full filename - "DBintro.nsf", not "DBintro".
Have you got the unique ID set as a text field because I have found that the formula has to be converted to a text value and not just the unique document id.
Set type of field "testid" to "Number"
Change formula to
Set column sort to "Descending"