3
votes

i have soft delete enabled database and i store these deleted documents into a view named 'DeletedDocuments' i have an action on this view to delete the soft-deleted documents permenantly... i have a HideWhen formula on the action stating that the action should hide when the view does not contains any documents

following is ma lotusscript for action bar

Function deleteSelectedDocuments As Boolean
    deleteSelectedDocuments=False
    Call setObjectVars()
    Dim documentCollection As NotesDocumentCollection
    Dim userChoice As Integer

    On Error Goto errHandler

    Set documentCollection=gDB.UnprocessedDocuments

    If documentCollection.Count=0 Then
        Msgbox "You have not selected any documents. Please choose some to delete em",,"No documents selected"
    Else 

        userChoice=Msgbox ("Do you want to delete " & Cstr(documentCollection.Count) & " document(s)?",64+100, _
        "Please confirm...")

        If userChoice=6 Then
            Call documentCollection.RemoveAll(True)
            Call gWk.ReloadWindow()
            Call gWk.ViewRefresh
        End If
    End If

    deleteSelectedDocuments=True
    Exit Function
errHandler:
    Print "Error ***" & Error & " occured on line ***" & Cstr(Erl) & "*** with error number ***" & Cstr(Err)  & "*** while attempting to delete selected documents"
    Msgbox "Error ***" & Error & " occured on line ***" & Cstr(Erl) & "*** with error number ***" & Cstr(Err)  & "*** while attempting to delete selected documents"
    Exit Function
End Function

i want to refresh my view once the documents are deleted and want to refresh HideWhen formulas too... i got something like uiDoc.RefreshHideFormulas but uiDoc doesnt work here... nor am i able to use @Command( [RefreshHideFormulas] ) in 'eveluate'... how do i go about it????

2
I haven't tested this, but what about: Call notesUIWorkspace.ReloadWindow()Simon O'Doherty
See my answer below- is that property checked?Rob Darwin

2 Answers

1
votes

You want to call

@Command([ RefreshHideFormulas ]);

after the gWk.ViewRefresh. You can use Evalute for that.

0
votes

Check the "Evaluate actions for every document change" view property on the DeletedDocuments view. If it's not checked, the Hide-When for the view action will only evaluate when the view is opened.