@DbLookup is not valid outside of the Notes client context and cannot be accessed via this method. Tough beans. Normally you follow a pattern something like the following when you're looking for something conceptually like @DbLookup. I'm posting this in LotusScript and you'll have to translate that into perl. I haven't use the OLE interface to perl so I don't want to just "wing" it.

If you follow that it's just (a) get the view, (b) find document(s) that match your criteria, (c) do something with them. Easy peasy.

If you need something faster/better then either (a) write an interface to the C or C++ API DominoPerl, (b) use the Java API (which works nicely) or (c) don't do it.

Const C_VIEW = "People" Const C_KEY = "Marvin Martian/IT/SomeCompany" Const C_ITEM = "Fullname" Dim S As NotesSession Dim Db As NotesDatabase Dim View As NotesView Dim Doc As NotesDocument Set S = New NotesSession Set Db = S.CurrentDatabase Set View = Db.GetView( C_VIEW ) Set Doc = View.GetDocumentByKey( C_KEY, True ) If Doc.HasItem( C_ITEM ) Then Print C_ITEM & ": " & Doc.GetFirstItem( C_ITEM ).Text Else Print C_ITEM & " Doesn't exist!" End If

Equivalent OLE code *might* look like this but you'll need to try it out for your self. In general you'll need to check out the LotusScript object model to see what is available.

use constant C_VIEW => "People"; use constant C_KEY => "Marvin Martian/IT/SomeCompany"; use constant C_ITEM => "Fullname"; use strict; use warnings; use Win32::OLE; my $notes = Win32::OLE->new('Notes.NotesSession') or die "Can't open Lotus Notes"; my $db = $notes->GetDatabase(@{&C_DB()}); die "Database was not opened" unless $db->IsOpen; my $view = $db->GetView( C_VIEW ); my $doc = $view->GetDocumentByKey( C_KEY, -1 ); if (defined $doc) { print C_ITEM . ": " . $doc->GetFirstItem( C_ITEM )->Text() . "\n" +; } else { print C_ITEM . " Doesn't exist!\n" }

Fun Fun Fun in the Fluffy Chair


In reply to Re^2: Accessing a Lotus Notes Database by diotalevi
in thread Accessing a Lotus Notes Database by scoombs

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.