• Taking away default view ID

    By Federico Belli 2 decades ago

    If you try to schedule .AgentCollectInfo on server different than windows it takes out the default view id.



    Possibile solution:

    replace in scripting DBDesign in method new of PlatformIndependentDatabaseDesign?



    Set tempView = db.views(0)

    If tempView.IsDefaultView Then<br/>
        If Not db.views(1) Is Nothing Then<br/>
            Set tempView = db.views(1)<br/>
            <br/>
        Else<br/>
            Exit Sub<br/>
        End If<br/>
    End If
    
    • Hello, what is your opinion to the following solution?

      By Joerg Reck 2 decades ago
          <br/>
          Dim designViewTemplateNote As NotesDocument<br/>
          Dim tempView As NotesView<br/>
          Dim designCollectionNote As NotesDocument<br/>
          Dim bIsDefaultView As Integer<br/>
          <br/>
          'get a view any view will do<br/>
          Set tempView = db.views(0)      <br/>
          If tempView.IsDefaultView Then<br/>
              bIsDefaultView = True<br/>
          Else<br/>
              bIsDefaultView = False<br/>
          End If<br/>
          Set designViewTemplateNote = db.getDocumentByUnid( tempView.universalID)<br/>
          Set designViewNote = designViewTemplateNote.copyToDatabase(db)<br/>
          Set designCollectionNote =  db.getdocumentbyid( &quot;FFFF0020&quot;)<br/>
          'strip off all the items<br/>
          Forall item In designViewNote.items<br/>
              item.remove<br/>
          End Forall<br/>
          designCollectionNote.copyAllItems designViewNote<br/>
          designViewNote.replaceItemValue DESIGN_NOTE_NAME_ITEM, &quot;(TemporaryDesignViewNote&quot; &amp; designViewNote.noteID &amp; &quot;)&quot;<br/>
          <br/>
          If bIsDefaultView Then<br/>
              tempView.IsDefaultView = True<br/>
          End If<br/>
      
      • Answer

        By Federico Belli 2 decades ago

        I thought about the same solution, but like that you change the signature of the remote view. I think mine is less intrusive, but there could be even something better… What do u think?

        • Answer 2 Signature...

          By Joerg Reck 2 decades ago

          Yeah you are right, it will change the signature of the view…..



          I try to get a view from agent monitor database and copy it to the target… So it schould work like this…


              Set session = New notesSession<br/>
              Set currentDB = session.CurrentDatabase<br/>
              'get a view any view will do<br/>
              Set tempView = currentDB.GetView(&quot;.fwrkNCKeyword&quot;)<br/>
              Set designViewTemplateNote = currentDB.getDocumentByUnid( tempView.universalID)<br/>
              Set designViewNote = designViewTemplateNote.copyToDatabase(db)<br/>
              Set designCollectionNote =  db.getdocumentbyid( &quot;FFFF0020&quot;)<br/>
          





          Greetings and thx JJR