Way back in the day I remember being able to trigger an LEI Job via LotusScript.
Is there a way to trigger an HEI Job via LotusScript?
Way back in the day I remember being able to trigger an LEI Job via LotusScript.
Is there a way to trigger an HEI Job via LotusScript?
Hi @Michael Williams ,
Yes, this is still possible. Refer to the sample LotusScript code below that disables or enables the HEI/LEI activity.
Sub Initialize On Error GoTo checkerrorDim session As New NotesSession Dim db As NotesDatabase Dim decsAdminDb As NotesDatabase Dim activityName As String Dim activityDoc As NotesDocument Dim activityStatus As Variant Dim activityView As NotesView ' Specify the name of the activity you want to trigger activityName = "Notes2Notes" ' Get the current database Set db = session.CurrentDatabase ' Specify the name of your HEI/LEI Admin database and activities view Dim decsAdminDbPath As String Dim decsAdminView As String decsAdminDbPath = "decsadm.nsf" decsAdminView = "(All Activities)" ' Open the HEI/LEI Admin database Set decsAdminDb = session.GetDatabase(db.Server, decsAdminDbPath) 'Open the Activities View Set activityView = decsAdminDb.Getview(decsAdminView) If Not decsAdminDb Is Nothing Then ' Get the HEI/LEI activity document Set activityDoc = activityView.Getdocumentbykey(activityName, true) If Not activityDoc Is Nothing Then ' Check if the activity is enabled or disabled If activityDoc.GetItemValue("Enabled")(0) = "1" Then Print "Activity is already enabled, disabling..." Call activityDoc.Replaceitemvalue("Enabled", "0") Call activityDoc.Replaceitemvalue("Enabled_Disp", "0") Call activityDoc.Computewithform(True, True) Call activityDoc.Save(True, False) Else Print "Activity is not enabled, enabling setting automatic schedule..." Call activityDoc.Replaceitemvalue("Enabled", "1") Call activityDoc.Replaceitemvalue("Enabled_Disp", "1") Call activityDoc.Computewithform(True, true) Call activityDoc.Save(True, False) End If Else Print "Activity document not found" End If Else Print "HEI/LEI Admin database not found" End Ifcheckerror:
If Erl >0 Then
Print "Error on line: " & Erl " >> " & Error
End If
End Sub
You can also find this in the following KB Article: How to trigger HEI Activity using LotusScript
Regards,
TJ