• Cleanup journal's private views...

    By Rob Breault 2 decades ago

    I've added the following code to the Journal DB's Database QueryClose event to clean up the private views during development and testing:



    Sub Queryclose(Source As Notesuidatabase, Continue As Variant)

    Dim views As Variant<br/>
    Dim view As NotesView<br/>
    Dim doc As NotesDocument<br/>
    Dim item As NotesItem<br/>
    Print &quot;Checking for private views...&quot;<br/>
    views = this_db.Views<br/>
    Forall v In views<br/>
        Set view = v<br/>
        Set doc = this_db.GetDocumentByUNID(view.UniversalID)<br/>
        If Not doc Is Nothing Then<br/>
            Set item = doc.GetFirstItem(&quot;$Flags&quot;)<br/>
            If Instr(item.Values(0),&quot;V&quot;) Then<br/>
                Print &quot;Removing private view: &quot; &amp; view.Name<br/>
                Call view.Remove<br/>
            End If<br/>
        End If<br/>
    End Forall<br/>
    Print &quot;&quot;<br/>
    

    End Sub

    • It's going in CratchitCommonLibrary

      By Dave Leigh 2 decades ago

      Thanks. As this is generally useful, I'm putting it in CratchitCommonLibrary as sDeletePrivateViews. and I'll call it from QueryClose. I'm thinking it may come in handy in the future to force changes to private-on-first-use views to users.

      • Versioning...

        By Rob Breault 2 decades ago

        One thing I have done it to put a "Version" number into the DBProfile and when new code gets droppped, I'd update a Database PostOpen to check it and if the versions don't match, then execute the necessary delete private views, etc code to cleanup and set the new version # in the DBProfile…

        • Versioning and Form Methods

          By Dave Leigh 2 decades ago

          Sounds good.



          One thing I plan to do shortly is to move business rules, etc. (including the methods for form events) into a library for each form (such as "VICJournalEntryRules", etc.) It doesn't change the code at all (except that the Formula Language will be converted to LotusScript)… just removes it to the script library. I've done this on some more recent projects, and makes managing the code quite a bit easier. There's quite a bit of old crap that had to be cleared out.



          I've removed most of the environment variable references today and was wishing I'd done it earlier. I'll post details under the task.