2008年11月3日 星期一

AppendDocLink 在 Script 不 working,的情況一:

AppendDocLink 在 Script 不 working,的情況範例 一 :

[範例來源:developerWorks > Lotus > Forums & community > Notes/Domino 6 and 7 Forum ]

也是我自己所遇過的情形之一:

問題:

AppendDocLink in Script not working
Posted by F1 Help on 12.Jul.07 at 上午 07:02 using a Web browser
Category: Domino DesignerRelease: 6.5.4Platform: Windows XP


Hi There,

I have a script library, and in there i would like to send a mail with a doc link to the relevent document. here is the code in the script :


Sub SendEmail(w,uidoc,strstatus)
'declare variables
Dim s As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim rtitem As NotesRichTextItem
Dim maildoc As NotesDocument
Dim strStatusDesc As String

'Set the variables

Set db = s.CurrentDatabase
Set doc = uidoc.document
Set maildoc = New NotesDocument(db)
Set rtitem = New NotesRichTextItem(maildoc, "Body")
'Assign a User-Friendly quote to the status number
If strstatus = "5" Then
strStatusDesc = "Awaiting Quote."
Elseif strstatus = "10" Then
strStatusDesc = "Awaiting Authorisation."
Elseif strStatus = "15" Then
strStatusDesc = "Order Placed."
Elseif strstatus = "20" Then
strStatusDesc = "Order Delivered"
Elseif strstatus = "25" Then
strStatusDesc = "Order Dispatched"
End If
'Prepare subject and body text

maildoc.subject = "Your I.T. Order is at status : " & strStatusDesc
maildoc.SendTo = doc.UName(0)
maildoc.Body = "Hello"
'Attach DocLink
Call rtitem.AppendDocLink(doc,"Your Order","")

'Send Mail

maildoc.Send(False)
End Sub

----

解決方式 :

Check in your database no Default view are there ....
untill unless have one difault view to send doclink

因為在資料庫中 沒有 預設的視界 ;只要再將資料庫的重新設定「預設的視界」,即可運作。