Part (a) in the code presents a link either to create a calendar database or to link to it if it is already there. The fragment of LotusScript from the "CreateCalendar" agent works out what to call the database and which directory to put it in from fields on the Web page. The fields can be hidden if necessary.
In the code, "libcard" and "login" are computed for display fields on the Web page.
a. (CreateCalendar agent reads field values
from Web page)
@If( @IsError(@DbColumn("";"":caldb;"E";1));
@Command([ToolsRunMacro];"CreateCalendar");
@URLOpen( "/"+caldb+"/cal?openview" )
)
b. (won't pick up field values)
@If( @IsError(@DbColumn("";"":caldb;"E";1));
"[<a href="/"+@WebDbName+"/
CreateCalendar">my calendar</a>]";
"[<a href="/"+caldb+"/cal">my calendar</a>]"
)
Set s = New NotesSession
Set doc = s.DocumentContext
If doc.libcard(0) = "" Then
calendarFilePath$ = CalFolder$ & "S/" &
doc.login(0) & ".nsf"
Else
calendarFilePath$ = CalFolder$ & Right$
(doc.libcard(0),1) & "/" &
doc.login(0) & ".nsf"
End If
Do you have comments on this tip? Let us know.
This was first published in November 2003