Showing posts with label lotus approach. Show all posts
Showing posts with label lotus approach. Show all posts

Tuesday, September 16, 2008

how we can remove temporary fields from document

Set a computed field in the bottom of the form with next formula:

@If(@IsDocBeingSaved; @Success; @Return(""));
@SetField("Field1"; @DeleteField);
@SetField("Field2"; @Unavailable);
@DeleteField

It is very simple and useful solutions as for me and to be honest I did not find any better way

Thursday, August 28, 2008

Redirect in WebQueryOpen

It looks like very simple task - redirect to another element in WebQueryOpen , but when I tried to do it it did not work ! I mean in WQO JavaScript does not work well (or probably at all).
So I found good solution for me, and I would like to share it:

We have to take current document and then change the value in $$HTMLHeader.

Tuesday, August 12, 2008

How we can change language in database?

Actually I have one task right now. The main goal of this task is to find the best approach for changing current language in database. Let's say we have lotus notes database on English language and we have to change it to Spanish / German / any other .

So, what I think, is to export this database in DXL, then we cut/took all English wording, translate them to new language, then we have to modify this DXL file and them import it back as database. It is only 1 approach, and I would be happy if anybody can propose any other.

It is really interesting for me, and I guess for other people.

Monday, August 04, 2008

software for testing application based on Lotus Notes

This question is quite important for me right now. Does anybody know about any approaches for testing application in Lotus Notes client?

Actually I tried to use couple of these kind software but I did not like any of them.

So my main question to Lotus community. Who has experience in this question and can advise?

Thanks!

Tuesday, May 13, 2008

how to run several Lotus Notes clients at the same time

Sometimes it is very useful to run several copies of Lotus Notes. Let's say in one client you run agent and in the same time you continue to work. Also it is very useful when you want to work with different servers at the same time with different IDs.

Here is approach how to do it!

1. We have to change the shortcut of notes: instead of launching a file notes.exe, you need to run nlnotes.exe
C: \ Lotus \ Notes \ nlnotes.exe "= C: \ Lotus \ Notes \ notes.ini"
For convenience, you can also rename the shortcut to "Notes 01"
2. Then we have to copy notes folder, for example in the folder C: \ Lotus \ Notes02
3. Modify notes.ini in new copy of Lotus Notes - we should correct the path with C: \ Lotus \ Notes \ to C: \ Lotus \ Notes02 \
4. Copy shortcut to run, it to "Notes 02, and the change the way.
C: \ Lotus \ Notes02 \ nlnotes.exe "= C: \ Lotus \ Notes02 \ notes.ini"
5. By using these shortcuts you can run two copies of lotus notes

If you repeat this, you can run any number of copies.

You can also change the color of notes desktop to don't forget which version you use now...

Wednesday, May 07, 2008

Evaluation of database

Simple example, how we can evaluation of database. Put this code in DatabaseScript on event PostOpen. I would like to see another examples, but I did not find

(Declarations)

Declare Function NEMGetCurrentSubprogramWindow Lib "nnotesws.dll" () As Long
Declare Function NEMStopSubprogramWindow Lib "nnotesws.dll" (Byval hwnd As Long) As Integer
Sub Postopen(Source As Notesuidatabase)
If Cdat("03/15/2009") < Cdat(Today) Then
Dim wHandle As Long
' Get window handle
wHandle = NEMGetCurrentSubprogramWindow
' Close current window
Call NEMStopSubprogramWindow(wHandle)
End If
End Sub

Add on by Olli Kämäräinen
We have to remember about international date, so here a solution how to fix potential problem...

Function MakeDate(dd As String, mm As String, yyyy As String) As Variant

Dim session As New NotesSession
Dim international As NotesInternational
Dim delim As String
Set international = session.International

delim = international.DateSep

If international.IsDateDMY Then
MakeDate = Cdat(dd & delim & mm & delim & yyyy)
'Messagebox "DMY",, "Format of date"
Elseif international.IsDateMDY Then
MakeDate = Cdat(mm & delim & dd & delim & yyyy)
Elseif international.IsDateYMD Then
MakeDate = Cdat(yyyy & delim & mm & delim & dd)
Else
'Messagebox "Unknown",, "Date"
End
End If

End Function

Tuesday, March 25, 2008

select in views with date

Very often we need to use Dates in view's SELECT. Let's say that we should show documents which are older than current day. What do we usually do?

SELECT FldName = @Now
SELECT FldName = @TextToTime("Today")


I just want to refresh head and show another approach. We can use schedule agent on server and modify SELECT formula each day.

Dim s As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim dt As String

Set db = s.CurrentDatabase
dt = Join(Evaluate({@Text(@Today)}))
Set view = db.GetView("viewName")
view.SelectionFormula = {SELECT Form = "Form" & FldDate = (([} + dt + {]}


after that it will work faster and better. it's just only one another approach not more, but I like it )

Wednesday, March 12, 2008

Securety for different parts of document. 1-st approach.

Let's say we have one document and it contains couple different areas, for example 1 part of document contains information about salary of employee and another one contains information about family of employee. Of course, fields that contains information about salary have to be hide from all eyes except special role (Finance department). Information about employee's family also has to be hide from all except (HR department). Application should work in Lotus Notes client and in WEB also.
We can't just hide fields using "hide formula", because smart users can use next approach and they can found fields with salary. But it should be private information.
So, I propose next approach, we can create one main document and N response documents (it depends on how many areas you have). Each response document will contain information about special area and also will contain information about Readers, in our case it will be 2 documents - 1 for Salary information + Readers field = "Finance department" and another one for HR department. All others manipulations it is only game with QueryOpen and QuerySave event in Client and Web.

Simple chart :-).
What I did:
1) on QO event I put code that take all data from response documents and put to main document. It is very usefull to use NotesItem.SaveToDisk = false in QO event, because in this case you can forget about removing values in QS event from main document.
2) on QS event I put code which takes values from main document and put data back to response documents.

Probably it is not the best way but it works.

Any new idea would be appreciate ! ;-)

Friday, March 02, 2007

cross

I want show my little but I think powerful application. It’s “Cross”. It allows registering database and then use it. Copy any database as link, then open cross.nsf and click “Paste DB Link” -> as a result you will see new document, when you click on it – the database it open. It’s something like as bookmark, but it’s not the end, it’s only 1 feature.

Second and main feature is that you can receive any database that contains in cross.nsf. Because when you register “database1” in CROSS you also create a profile document “cross” in “database1” that contain information about location of cross.nsf, (server and replica id). So you can receive cross database and then receive any database that register into it. I think it’s not bad if you have a big system with more then 5-10 databases and all of them are communicate with each other.