Integra for Notes Banner
  QuickReports Integra4Notes Integra Family of Products

Integra Script Library Documentation


Context:

General

Library/Class:

Sample Code



Import new Notes documents or update existing ones As Integer, Read/Write

Const CB_INITIALISE = 3
Const CB_BFORIMPORT = 11
Const CB_BFORREADCOM = 7
Const CB_BFORWRITENOTES = 2
Const CB_TERMINATE = 4

select case stats.cbstatus
case CB_INITIALISE
case CB_BFORIMPORT
case CB_BFORREADCOM
case CB_BFORWRITENOTES

    ' The following code will search for an eventual existing
    ' document with the same common key stored in the
    ' field DocID (which in this example stores a Notes UNID)

    Dim db As NotesDatabase
    Dim doc As NotesDocument

    Set db = stats.ImpDoc.ParentDatabase

    If stats.ImpDoc.DocID(0) = "" Then
      ' If no UNID available then this is a new document
      ' so we can leave it up to Integra to handle it.
    Else
      ' Note: the next code line can cause a runtime error if
      ' the UNID does not exist. As you cannot use the
      ' On Error Goto statement inside executed Lotus Script,
      ' you need to add some script in the Script Error Handler
      ' (Integra profile) to ignore this error.

      Set doc = db.GetDocumentByUNID(stats.ImpDoc.DocID(0))

      If Not doc Is Nothing Then
        ' existing contact to be updated by copying
        ' the fields from the temporary import document
        ' into the existing document.

        doc.FirstName = stats.ImpDoc.FirstName(0)
        doc.MiddleInitial = stats.ImpDoc.MiddleInitial(0)
        doc.LastName = stats.ImpDoc.LastName(0)
        doc.Title = stats.ImpDoc.Title(0)


        ' ... any other field that is listed in the Selected Field List
        ' of the Integra profile.

        Call doc.Save(True,False)

        ' We need to tell Integra not to continue with the import
        ' of the current document
        Import.Continue = False
      Else
        ' new contact, let Integra do the job
      End If
    End If
case CB_TERMINATE
end select


 
QUICK LINKS
 
 

 

  © Shireburn Software Ltd. 2008 - 2024