• database.PostOpen

    By Matthew Montgomery 2 decades ago

    So, I'm new to this Notes thing, and learning and all I want it to do is check and see if the user already has a document, if they do, then open that one (on open for the database), if not, create one. All other forms/documents are driven by this one and each employee only gets one per year. The view (so uniquely named 'My Documents' works and only returns a collection of documents by

    @Name([CN];@UserName). essencially if Doc = view.GetFirstDocument Is Nothing then it should create a document based the form "Sales Report" if its a document then that should be opened for editing.



    I know this probably sounds stupid to most of you advanced coders but I've tried a thousand things and I dont think that the dumb database is even executing the script in PostOpen which I borrowed from this site:


    Dim session As New Notessession <br/>
    Dim ws As New NotesUIWorkspace <br/>
    Dim db As NotesDatabase <br/>
    Dim view As NotesView <br/>
    Dim doc As NotesDocument<br/>
    Dim uidoc As NotesUIDocument<br/>
    Set db = session.CurrentDatabase<br/>
    Set view = db.GetView(&quot;My Documents&quot;)<br/>
    <br/>
    On Error Resume Next <br/>
    Set doc = view.GetFirstDocument<br/>
    <br/>
    If doc Is Nothing Then<br/>
        Set uidoc = ws.ComposeDocument(&quot;&quot;,&quot;&quot;,&quot;SalesReport&quot;) <br/>
    Else<br/>
        ws.OpenDatabase &quot;&quot;,&quot;&quot;,&quot;SalesReport&quot;<br/>
        ws.EditDocument <br/>
    End If <br/>
    



    Any input would be MOST appreciated.



    feel free to contact me at GroundHoundFive@Yahoo.com

    -MCM

    • Sorry but ..

      By Ulrich Krause 2 decades ago

      you missed the lane ..



      !!HELP!! is not a forum.



      We should think about changing the name of this project …

      • nice forum

        By Matthew Montgomery 2 decades ago

        thanks for the news flash, and the no help…I got it.

        So basically, if someone has a question, if it isnt regarding one of your projects, then they can just go to hell then…nice forum…I hope you do well with it.

        • calm down !!

          By Ulrich Krause 2 decades ago

          >> So basically, if someone has a question, if it isnt regarding one of your projects, then they can just go to hell then…nice forum…I hope you do well with it.



          hmm, maybe this is a misunderstanding; !!HELP!! is a project, not a forum. OpenNTF has a forum for general questions. Pls. take a look at the main bar …