2017-06-16 11 views
0

問題に動作していない:エージェントは異なるリンクに、サーバーのリンクが正しく

  • メールを与えるデータベースが含まれていないリンクが含まれ実行して、メールを送信する使用

    1. Sub Initialize() 
      Print"Agent:First Reminder for LateIn Reason started running at " & DateValue(Now()) & "," + TimeValue(Now()) 
      Dim ss As New NotesSession 
      Dim db As NotesDatabase 
      Dim LateInVw As NotesView 
      Dim LateInDocs As NotesViewEntryCollection 
      Dim LateEntry As NotesViewEntry 
      Dim LateDoc As NotesDocument 
      Dim StaffVw As NotesView, StaffDoc As NotesDocument 
      Dim MailDoc As NotesDocument 
      Dim rtBody As NotesRichTextItem 
      Dim sysdoc As NotesDocument, sysVw As NotesView 
      Dim AttVw As NotesView, Attdoc As NotesDocument 
      
      Set db=ss.Currentdatabase 
      
      Set sysVw=db.getview("($System Settings)") 
      Set sysdoc=sysvw.getfirstdocument 
      If sysdoc Is Nothing Then Exit Sub 
      
      
      Set LateInVw=db.getview("(Testing Late-In Time Records)") 
      
      
      Set StaffVw=db.getview("($Active Staff by ID)") 
      
      Set AttVw = db.Getview("($Effective Attendance Setting By ID)") 
      tdy=Datevalue(Now) 
      
      'get all time records for today 
      Set LateInDocs=LateInVw.Allentries 
      Set lateEntry=LateInDocs.getfirstentry 
      Do While Not LateEntry Is Nothing 
          Set LateDoc=LateEntry.Document 
          Set Attdoc=Attvw.Getdocumentbykey(LateDoc.TStaffID(0), True) 
          If Attdoc.LateAtt(0)="Yes" Then 
          If LateDoc.LateReason(0)="" Then 
           If Not ApprovedLateIn(LateDoc, LateDoc.TAmend(0), False) Then 
           'get staff mail 
            Set staffDoc=StaffVw.Getdocumentbykey(LateDoc.TStaffID(0), True) 
            If Not staffdoc Is Nothing Then 
            'send email with link to main menu 
             If email$<>staffDoc.email(0) Then 
             ' email$=staffDoc.email(0) 
              email$="[email protected]" 
              Set Maildoc=New NotesDocument(db) 
              Set maildoc=db.Createdocument() 
              maildoc.Form="First Reminder Notification" 
              maildoc.Subject="Smartcard Attendance System: Late-In Notification for " +Format$(LateDoc.TDate(0),"dd/mm/yyyy") 
              Maildoc.StaffName=staffDoc.StaffName(0) 
              maildoc.Sendto="[email protected]" 
             ' maildoc.NotifyDate=LateDoc.Tdate(0) 
              maildoc.NotifyTime=Timevalue(LateDoc.TAmend(0)) 
              maildoc.NotesServer=sysdoc.ServerPath(0) 
              maildoc.NotesDBPath=sysdoc.DBPath(0) 
              maildoc.send(True) 
             End If 
            End If 
           End If 'check against unimas's jadual kedatangan 
          End If 'check for late in reason 
          End If 'check late-in on/off in attendance settings 
          Set LateEntry=LateInDocs.Getnextentry(LateEntry) 
      Loop 
      
      
      End Sub 
      
    実際に私が

    ノートとして置きたい、あなたがそれを見ることができます

    私は私のイメージファイルを添付し、この2画像から

    wrong path come out from mail

    correct path

    ここにコーディング:// Mulu/SmartCard Attedancce/sas-server.nsf/Scais Main?OpenFrameset

    メールの送信結果は

    です

    メモ://// Scais Main?OpenFrameset

    サーバーとデータベースはありません。カスタムフォームで外部メールを送信:私は別の添付ファイルは、私がmail.formとして使用フォーム Form

    hotspot link include script

  • 答えて

    2

    まず第一になります

    間違っている私のコーディングのどの部分を確認していませんターゲットシステムがすべてのものを適切にレンダリングできない可能性があるので、それは最良のアイディアではありません。

    私はまず、すべてのデータを含む文書を作成し、それをmaildocにレンダリングします。コードは次のようになります。

    Dim Templatedoc as NotesDocument 
    Dim body as NotesRichtextItem 
    
    Set Templatedoc=New NotesDocument(db) 
    Set Templatedoc=db.Createdocument() 
    Templatedoc.Form="First Reminder Notification" 
    Templatedoc.StaffName=staffDoc.StaffName(0) 
    ' maildoc.NotifyDate=LateDoc.Tdate(0) 
    Templatedoc.NotifyTime=Timevalue(LateDoc.TAmend(0)) 
    Templatedoc.NotesServer=sysdoc.ServerPath(0) 
    Templatedoc.NotesDBPath=sysdoc.DBPath(0) 
    
    Set maildoc=New NotesDocument(db) 
    maildoc.Form = "Memo" 
    maildoc.Subject="Smartcard Attendance System: Late-In Notification for " +Format$(LateDoc.TDate(0),"dd/mm/yyyy") 
    maildoc.Sendto="[email protected]" 
    
    Set body = New NotesRichtextItem(maildoc, "Body") 
    Call Templatedoc.RenderToRTItem(body) 
    
    maildoc.send(True) 
    

    第二:あなたは、あなたのリンクを計算するために、二つのフィールド(NotesServerとNotesDBPath)を設定します。しかし、現実のあなたのリンクは環境変数から計算され、これらはサーバー上で設定されません。

    にあなたのリンク - Computation-式を変更し

    リンクのためのトリックを行う必要があります
    srv := NotesServer; 
    pth := NotesDBPath; 
    

    +0

    ok、リンクされた提案はすでに正しく動作していますが、それでも私はフレームセット自体を開くことができません...それはまだデータを含む "view"に行きます。 "LateInVw"私は遅い人のためだけにこのビューをループし、後で〜の理由を入力するためにそれらをフレームセットに移動させます –

    関連する問題