How can i get the value of lotus notes field corresponding to sub form

Posted on 2014-09-01
Last Modified: 2014-09-02
I have an nsf file  from which i would like to export the information corresponding to a field.

The problem is that i can't see the field on the NotesDocument even when i am retrieving it directly from database by Id.

I guess is because is defined in a subform.

I am not familiar with lotus so please help me to find the right code or give me some advice on how i should approach the problem.
Question by:Nordicit
    LVL 46

    Expert Comment

    by:Sjef Bosman
    Sorry, I don't understand how you intend to attack this problem. What applications or tools do you have or use? There are all sorts of more or less relevant Notes elements in your question, but I fail to see the bigger picture. You say you have an nsf file, but do you have Notes? What is "retrieve by ID"? How do you try to "see" a field in a NotesDocument? What do you use to get this NotesDocument in the first place? What does the subform have to do with it?

    Could you give us more information, e.g. what is the development environment that you use to tackle this problem, and what exactly do you want to accomplish?

    Author Comment

    I use Lotus Notes, Notes designer and odbc explorer.

     Dim docCase As NotesDocument
     Set docCase = s.CurrentDatabase.GetDocumentByUNID( doc.XREFID(0))
      Set rtitem = docCase.GetFirstItem( "SWAttachment" )

    doc comes as parameter from a view which does not contain "SWAttachment"  but as far as i understand this function s.CurrentDatabase.GetDocumentByUNID( doc.XREFID(0)) should retrieve the whole document with all the fields.(it doesn't)

    SWAttachment is part of a subform which is part of a  form on which  the view was created.(at least this is what i can see I could be wrong)

    Sorry but I am not at all a Lotus developer I just need this task to be done. Hope is more clear now.
    LVL 46

    Expert Comment

    by:Sjef Bosman
    Ah, Swing... :-)

    A document is always "whole", but its fields do not have to match the form used to create the document. A form only serves to show a document on the screen. Fields that are on the form but not in the document are just left empty (or initialized using the form's formulas) and fields not on the form are simply not shown.

    AFAIK SwAttachment is a rich-text field, and this type of fields cannot be shown in a view. That would explain its absence from the view.

    Still uncertain about what your "task" is. What do you want to do with the contents of the field SwAttachment?

    Author Comment

    Thanks for your reply.

    I have to import notes documents to a different system.(I can import all the data except pdfs saved to some fields)

    In this SwAttachment field is saved a pdf file. Through odbc explorer i can see the field on  the table but I can't import it(I have read on the internet that this is not possible i have to use a script to export these files.)

    Then i have tried to build a script which would go through all notes documents extract this pdf and save it to a certain folder.

    The only part which i am missing is how to access that field.

    If i am going with debugger through items list on the note document that field is missing but i am sure that is there because i can see it through odbc and i can open it in lotus notes.
    LVL 46

    Accepted Solution

    Migrating away eh? Bad idea... Better move to XPages and keep the Domino database.

    Anyway, here's a script that will save all attachments, it might need some tinkering:

    Author Closing Comment

    Finally it works.

    Thanks a lot.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    Goal:  To set up a secure SSH server for your home computer to make it accessible anywhere AND to use it as a port forwarding proxy. Steps 1.  WinSSHD version 5 is free for personal use.  So download and install it.  You can download it from the…
    Have you ever stumbled upon a software that is so great that you just love? It happened to me. Love at first sight. Filezilla Server.   Ok its not the most advanced ftp server I've came across. But its a fairly simple piece of software to get the …
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now