Wednesday, January 02, 2008

how to take all schedule agents from db

it takes all schedule agents from database. I suppose that somebody will find better solution, but for this moment I don't see the better solutions...

Dim s As New NotesSession
Dim db As NotesDatabase
Dim nc As NotesNoteCollection

Set db = s.CurrentDatabase

Set nc = db.CreateNoteCollection(False)
nc.SelectAgents = True
Call nc.BuildCollection

Dim note As NotesDocument
Dim nid As String
Dim flag As String

nid = nc.GetFirstNoteId
For i = 1 To nc.Count

Set note = db.GetDocumentByID(nid)
flag = note.GetItemValue("$Flags")(0)

If Instr(flag, "S") Then
Print note.GetItemValue("$Title")(0)
End If
nid = nc.GetNextNoteId(nid)
Next

Lotus Blogs

I found 2 sites which store many lotus notes's blogs. I'll look at them more closely later, but in any case I like it and recommend to lotus notes developers to save the links.

One of them is DominoBlogs.com - I suppose the oldest and another one is Planet Lotus.

Friday, December 21, 2007

Windows 95 or Windows NT

I was surprised when my friend shown me this in "help" ! I gave respect to Lotus after that.

This example compiles and runs in either Windows 3.1, Windows NT, or Windows 95. Depending on whether the application is compiled and run under 16-bit Windows (Windows 3.1) or 32-bit Windows (Windows 95 or Windows NT), you should declare and use an appropriate Windows handle variable and the appropriate version of two Windows API functions.

GetActiveWindow returns the handle (an Integer in 16-bit Windows, a Long in 32-bit Windows) of the currently active window. GetWindowText returns the text in the window title bar.

Dim winTitle As String * 80
%If WIN16 ' 16-bit Windows
Dim activeWin As Integer ' Window handles are Integer.
Declare Function GetActiveWindow% Lib "User" ()
Declare Function GetWindowText% Lib "User" _
(ByVal hWnd%, ByVal lpstr$, ByVal i%)
%ElseIf WIN32 ' 32-bit Windows
Dim activeWin As Long ' Window handles are Long.
Declare Function GetActiveWindow& Lib "User32" ()
Declare Function GetWindowText% Lib "User32" _
Alias "GetWindowTextA" _
(ByVal hWnd&, ByVal lpstr$, ByVal i&)
%End If
' Print the name of the currently active window.
activeWin = GetActiveWindow() ' Returns an Integer or a Long.
Call GetWindowText(ActiveWin, winTitle$, 80)
Print winTitle$

Wednesday, December 19, 2007

is XML going to leave us? JSON is next?

SON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language, Standard ECMA-262 3rd Edition - December 1999. JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Python, and many others. These properties make JSON an ideal data-interchange language.

JSON is built on two structures:

* A collection of name/value pairs. In various languages, this is realized as an object, record, struct, dictionary, hash table, keyed list, or associative array.
* An ordered list of values. In most languages, this is realized as an array, vector, list, or sequence.


here is a link to example JSON in Lotus Notes:
http://www.openntf.org/Projects/pmt.nsf/ProjectLookup/JSON%20LS

I will think about weak sides of every technology and will write later.

Enjoy

Tuesday, December 18, 2007

$V2AttachmentOptions

We can hide attachments using $V2AttachmentOptions field with Computed for Display type

What I usually do is set its value using the next formula:
@If(@IsDocBeingEdited; "1"; "0")

It will help to hide/show attachments in form.

p.s. dont forget about Computed for display