-2

I need help creating a validation report button that gets a document from a view, and collects the document according to request type (which is "delete"). After getting the document, it must then be compared to a different view from a different database, after finding a document that matched the "Category", "serial number/ badge number".

I'm new to Lotus scripting, so please help me out. Thanks a lot! Here's my sample code:

Dim Session As NotesSession
Dim db As NotesDatabase
Dim CasToolDB As NotesDatabase
Dim BadgeDB As NotesDatabase
Dim CasCol As NotesViewEntryCollection
Dim BadgeCol As NotesViewEntryCollection
Dim CasView As NotesView
Dim BadgeView As NotesView
Dim CTEntry As NotesViewEntry
Dim BEntry As NotesViewEntry
Dim CasToolDocs As NotesDocument
Dim BadgeDocs As NotesDocument

Set BadgeCol = BadgeView.GetAllEntriesByKey("Category", False)

Set BEntry = BadgeCol.GetFirstEntry
While Not BEntry Is Nothing
    Set BadgeDocs = BEntry.Document

    Set BadgeDocs = BadgeDocs.GetItemValue("Delete")        
Wend

'Set CasCol = CasView.GetAllDocumentsByKey("Category", False)

Thanks for the help in advance!

Dmytro Pastovenskyi
  • 5,240
  • 5
  • 37
  • 56
TeamTam
  • 1
  • 2
  • 1
    What is your issue? From what I see there are tons of them here and stackoverflow is not a place to write code for you. Please describe you current issue. – Dmytro Pastovenskyi Oct 20 '15 at 07:53
  • You need to initialize your objects (Session, BadgeDB,etc) first. – umeli Oct 20 '15 at 08:18
  • This code has a LOT of problems / errors. First of all: It is an endless loop, as there is no `Set BEntry = BadgeCol.GetNextEntry( BEntry )` before the `Wend`. Then the line `Set BadgeDocs = BadgeDocs.GetItemValue( "Delete" )` is nonsense in more than one way, and as umeli pointed out not even one object is initialized. I think you need a training or need to carefully read designer help and try out the examples in there to get a "feeling" about LotusScript classes, etc. – Tode Oct 20 '15 at 08:55

1 Answers1

0

This plattform is NOT here for making your work. YOU write code and ask for CONCRETE problems. You need to understand the structure of a language before you start writing code.

To achieve what you want you would need to go through the following steps:

  1. Initialize your "source"- database
  2. Initialize the view in the source database you cycle through
  3. Initialize "target"- database
  4. Initialize view in target database to search for your key consisting of
  5. cycle through the entries in the source view to get a NotesDocument
  6. Read Category / serial- number / whatever from document using GetitemValue values from 4.
  7. get document in target view that matches your key
  8. compare the two documents

After all this is not much code, and you already have a good starting point, but you really need to UNDERSTAND the LotusScript classes and how they depend on each other, otherwise you will not be successful.

Tode
  • 11,795
  • 18
  • 34