|
|
|
|
|
|
|
|
|
|
|
|
|
|
Tips and tricks in LotusScript (continued)
Dim recdateV As Variant
y = Mid(text,i,4)
m = Mid(text,6,2)
d = Mid(text,8,2)
recdateV = Datenumber(y,m,d)
|
This will work every time because DateNumber has three parameters where you specifically state the month and day separately. Thus, it's unconnected with the machine's current date format settings. Once you have the value in a variant, you use it to set the LSLocalTime of the NotesDateTime:
recdate.LSLocalTime = recdateV
|
This works because the LSLocalTime value is a variant as created by DateNumber. The time part of LSLocalTime matches the TimeNumber value, so you can actually create the whole NotesDateTime value as follows:
Dim recdate As New NotesDateTime(today) 'don't care at this point what the date value is...
Dim recdateV As Variant
Dim rectimeV As Variant
'assuming text contains a string, formatted: 2003-01-02 12:30:54
y = Mid(text,1,4)
m = Mid(text,6,2)
d = Mid(text,9,2)
h = Mid(text,12,2)
n = Mid(text,15,2)
s = Mid(text,18,2)
recdateV = Datenumber(y,m,d) 'value to left of decimal point
rectimeV = Timenumber(h,n,s) 'value to right of decimal point
recdate.LSLocalTime = recdateV + rectimeV
|
Running agents on the server One thing I didn't have to worry about on the mainframe was where code executed. It always happened on the mainframe, and the mainframe terminal was dumb, even dumber than early Web browsers. But in the client/server architecture of Notes, things are a little different, particularly when it comes to agent code. By and large, it's possible to say that in Notes, if the user action starts something off, it happens on the client, and if the server starts it, it happens on the server.
That's all very well, until you start to need back-end connectivity from your Notes application. You may want to be able to connect to the backend from the Notes client but don't want the hassle and cost of backend connectivity connection being installed on every computer. This is where NotesAgent.RunOnServer comes in.
One application I did recently for a customer was to look up information about end-users' computers in a DB2 database, using user identification details from the Domino address book. Use the DB2 LSX, I thought, easy. Hazily remembering how I'd used DB2 in the past, I wrote an agent that would format the SQL, execute it, get results, and create Notes documents. But I don't have a DB2 client enabled on my laptop, and even if I had one, and I don't, it isn't the final execution environment. That is a Domino server, which already has a DB2 client enabler. But then to test my application, I have to run the agent on the server.
First thoughts would be to use a scheduled agent, but that's a real pain to keep rescheduling it as you create and test it. Another one is to install a client on the server and run the agent there. Then I could also use the script debugger to get the agent working. If the server is physically accessible and runs NT or Win2K where you can install a client, that's fine, but it might be an AIX server. Actually it was an NT4 server, and I did do my early testing with a client on the server, but that spoils the story.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Advertisement --
Sophisticated Meets Simple For Document Management
Share. Control. Manage.
Documents, emails, and content in the context of how work is done.
Native to Lotus Domino. The User Experience unseen for Lotus Domino.
Do more with less. Really.
See the possibilities Docova unleashes for Lotus Domino. |
-- Advertisement --
Integrate your Notes Applications with Microsoft Office and Symphony
Integra for Notes Integrates Microsoft Office and/or IBM Lotus Symphony
Requires NO change to the design of the appliation or Installations of DLL's and EXE's
- Integra is a ready to use solution, enhance static reports with Excel data analysis, pivot tables, macros
- User friendly aproach, using a point and click access to features
- Reports from any Lotus Notes databases
- Runs reports through a Notes client, web browser and scheduled basis
- Allows use of LotusScript for advanced data manipulation
- Enables self service reporting capabilities to end-users
Learn more at www.integra4notes.com. |
|
|
|
|
|
|
|
|
|
|