Lotus Notes — рабочий инструмент программиста.

Обсуждения программирования на Lotus Notes/Domino

Archive for Декабрь 1st, 2008

Using Formula language code to sort Lotus Notes messages by subject

без комментариев

Lotus Notes will sort messages by Date, Sender and Subject with prefixes such as Re: and Fwd:. This Formula language code will customize your All documents view by stripping out prefixes to easily sort Lotus Notes messages by subject alone.

Original source : http://feeds.feedburner.com/~r/techtarget/Searchdo…

Написано lotusnotes

Декабрь 1, 2008 в 10:49

Опубликовано в Lotus Notes

Workaround formats bulleted/numbered lists in Lotus Notes documents

без комментариев

Many Lotus Notes Domino administrators can be frustrated with some limitations when using bulleted and/or numbered lists in Lotus Notes, specifically that a list restarts when you add a blank line. This workaround lets you maintain the proper order in your formatted lists in Lotus Notes.

Original source : http://feeds.feedburner.com/~r/techtarget/Searchdo…

Написано lotusnotes

Декабрь 1, 2008 в 10:48

Опубликовано в Lotus Notes

How to create dynamic JavaScript in Notes Domino without formulas

без комментариев

If you need to create a large amount of dynamic JavaScript and you’re not familiar with the use of @DBColumn and @DBLookup formulas, this tip is for you. Placing this code in your HTML Head Content section is a simple workaround for busy Lotus Notes Domino developers.

Original source : http://feeds.feedburner.com/~r/techtarget/Searchdo…

Написано lotusnotes

Декабрь 1, 2008 в 4:54

Опубликовано в Lotus Notes

LotusScript sorts a Lotus Notes document collection

без комментариев

This LotusScript code shows how to sort a Lotus Notes document collection in ascending order using a specified field (text/date/number) as the key. The code is customizable, so you can easily change it to meet your needs.

Original source : http://feeds.feedburner.com/~r/techtarget/Searchdo…

Написано lotusnotes

Декабрь 1, 2008 в 4:53

Опубликовано в Lotus Notes

Delete BES State Databases

без комментариев

‘Options
Option Declare ‘ Declarations
‘%INCLUDE "LsConst.LSS"
‘ msgBoxOptions = MB_YESNO + MB_ICONQUESTION + MB_DEFBUTTON2
Const msgBoxOptions = 4 + 32 + 256
‘ yes = IDYES
Const yes = 6 Sub Click(Source As Button)
‘ posted to http://www.openntf.org/projects/codebin/codebin.nsf/CodeByDate/3307822D17936284862575000058210D
‘ written by Mike Mortin, 20081015 Dim ui As New NotesUIWorkspace
Dim uidoc As NotesuiDocument
Dim db() As NotesDatabase
Dim user As String, serverList() As String, msg As String
Dim index As Long, numDbs As Long
Dim deleteDbs As Boolean ‘ set up
Set uidoc = ui.CurrentDocument
user = uidoc.FieldGetText("firstname") & " " & uidoc.FieldGetText("lastname")
deleteDbs = False ‘ get the server names
If 0 Then
‘ hard code the server names
Redim serverList(0 To 2)
serverList(0) = "BES01/SVR/CA"
serverList(1) = "BES02/SVR/CA"
serverList(2) = "BES03/SVR/CA"
Else
‘ load from a group
Dim s As New NotesSession
Dim doc As NotesDocument
Dim key(0) As Variant
key(0) = "BlackBerryServers" ‘ <– put the group name that contains your BlackBerry servers
Set doc = GetDocFromDb(s.CurrentDatabase, "Groups", key, True)
Redim serverList(Lbound(doc.Members) To Ubound(doc.Members))
For index = Lbound(doc.Members) To Ubound(doc.Members)
serverList(index) = doc.Members(index)
Next
End If ‘ grab each database
Redim db(Lbound(serverList) To Ubound(serverList))
For index = Lbound(serverList) To Ubound(serverList)
Set db(index) = GetDbByTitle(serverList(index), user)
If Not db(index) Is Nothing Then numDbs = numDbs + 1
Next If numDbs = 0 Then
‘ tell admin that there are no state dbs found
Messagebox("No State database for " & user & " were found.")
Else
If numDbs = 1 Then
‘ find the active Db
For index = Lbound(serverList) To Ubound(serverList)
If Not db(index) Is Nothing Then Exit For
Next ‘ let the admin know which server the db was found on and prompt to delete
msg = "State database for " & user & " only found on " & db(index).Server & ". Do you want to delete this file?"
Else
‘ prompt to delete all replicas
msg = "Are you sure you want to delete the " & numDbs & " state databases for " & user & "?"
End If If Messagebox(msg, msgBoxOptions) = yes Then deleteDbs = True
End If ‘ delete the dbs
If deleteDbs Then
For index = Lbound(serverList) To Ubound(serverList)
If Not db(index) Is Nothing Then db(index).Remove
Next
End If
End Sub Function GetDbByTitle(serverName As String,userName As String) As NotesDatabase
On Error Goto ExitSub
Dim server As NotesDbDirectory
Dim db1 As NotesDatabase, db2 As NotesDatabase ‘ Find db on server
Set server = New NotesDbDirectory(serverName)
Set db1 = server.GetFirstDatabase(DATABASE)
While Not (db1 Is Nothing)
If userName = db1.Title Then
If db2 Is Nothing Then
Set db2 = db1
Else
Msgbox "Duplicate db title found on "& serverName
Exit Function
End If
End If
Set db1 = server.GetNextDatabase
Wend ExitSub: Set GetDbByTitle = db2
Exit Function
End Function

Original source : http://www.openntf.org/projects/codebin/codebin.ns…

Написано lotusnotes

Декабрь 1, 2008 в 6:16

Опубликовано в Lotus Notes

is application on local or not (function)

без комментариев

this function checks if the current application is on the server or local. true = is on local
false = is on a server Its a very small and easy function. But sometimes useful ;-)

Original source : http://www.openntf.org/projects/codebin/codebin.ns…

Написано lotusnotes

Декабрь 1, 2008 в 6:16

Опубликовано в Lotus Notes

Open database listed in an email ( like GSX errors )

без комментариев

Sub Initialize
‘ posted to http://www.openntf.org/projects/codebin/codebin.nsf/CodeByDate/BB07663266C769D2862574F60054154B
‘ written by Mike Mortin, 20070830 Dim ws As New NotesUIWorkspace
Dim uiDoc As NotesUIDocument
Dim nServer As NotesName
Dim tempStr As String, fileList As String, server As String
Dim tempVar As Variant
Dim index As Integer
Const kDelim = " " ‘ get email content
Set uiDoc = ws.CurrentDocument
tempStr = uiDoc.FieldGetText("body") ‘ split and join to remove unwanted characters
tempVar = Split(tempStr, Chr(13)) ‘ new line characters
tempVar = Join(tempVar, kDelim)
tempVar = Split(tempVar, "’") ‘ single quotes
tempVar = Join(tempVar, kDelim) ‘ lastly, split into words
tempVar = Split(tempVar, kDelim) ‘ spaces ‘ server name is the next entry
Set nServer = New notesName(tempVar(3))
server = nServer.Common ‘ then parse through remaining entries to get all mailfiles listed
For index = Lbound(tempVar) To Ubound(tempVar)
Print tempVar(index)
If Instr( tempVar(index), ".nsf" ) > 0 Then
‘ add it to the list
tempStr = Left( tempVar(index), Instr( tempVar(index), "nsf") +2 )
fileList = fileList & tempStr & ","
End If
Next index ‘ now, did we find any mail files? If Len(fileList) > 0 Then
‘ make the list and tighen it up
tempVar = Split( fileList, "," )
tempVar = Arrayunique(tempVar)
tempVar = Fulltrim(tempVar) ‘ present and open the db
tempStr = ws.Prompt(4, "Select the database on " & server & " that you want to open.", "Click ‘Cancel’ to exit.", "", Split( fileList, "," ))
If tempStr <> "" Then Call ws.OpenDatabase(server, tempStr)
Else
Msgbox "No mailfiles detected"
End If
End Sub

Original source : http://www.openntf.org/projects/codebin/codebin.ns…

Написано lotusnotes

Декабрь 1, 2008 в 6:16

Опубликовано в Lotus Notes