Solved

Unable to send document link to email account

Posted on 2004-08-17
2
321 Views
Last Modified: 2013-12-18
I want user to send this document link to other user email when user click on a mailsend button.
There is a names field called mailto which contains multiple user email addresses.
Thus when user has finished choosing the selected recipients, he will click on the mailsend button to send the document to them. But when click on mailsend button, i get the following error : Couldn't get dafault view id for database

Pls help.
Thanks.

Code for mailsend button:

Sub Click(Source As Button)    
      
      Dim ws As New NotesUIWorkspace
      Dim uidoc As NotesUIDocument
      Set uidoc=ws.CurrentDocument
      Call uidoc.Save
      Dim session As New NotesSession
      Dim db As NotesDatabase
      Dim newDoc As NotesDocument
      Dim curdoc As NotesDocument
      Dim rtitem As NotesRichTextItem
      Set db = session.CurrentDatabase
      Set curdoc = uidoc.Document
            
      Set newDoc = New NotesDocument(db)
      
      newDoc.Form = "Memo"              
      newDoc.Subject = "<From Sales Meeting DB>" + "[" + uidoc.FieldGetText("Group") + "]" + uidoc.FieldGetText("Subject")
      
      pText ="The following was issued from " + uidoc.FieldGetText("pic") +Chr(10)+Chr(10)_          
      + "   <Subject>  : "+ uidoc.FieldGetText("Subject") + Chr(10) + Chr(10)_
      + "   <Group>  : "+ uidoc.FieldGetText("Group") + Chr(10)_
      + "   <Region>  : "+ uidoc.FieldGetText("Customer") + Chr(10)_
      + "   <Category>  : "+ uidoc.FieldGetText("Category") + Chr(10) + Chr(10)_
      + "   <Contents> : " + Chr(10)          
      
      Text_2 = "    Sales Meeting Document Link (for Notes user only) ->  "
      
      Set rtitem = New NotesRichTextItem(newDoc, "Body")
      
      Call rtitem.Appendtext( pText )      
      Call rtitem.AddNewLine(1)    
      Call rtitem.Appendtext( Text_2 )    
      Call rtitem.AppendDocLink(curdoc,"")       
      Call newdoc.Send(False,uidoc.FieldGetText("mailto"))
                    
      
      Messagebox("Mail send completed.")
      
      Call uidoc.Save()    
      Call uidoc.close
            
      Exit Sub

      
End Sub
0
Comment
Question by:kopibean
  • 2
2 Comments
 
LVL 19

Expert Comment

by:madheeswar
ID: 11827448
I suspect ur getting error here:
pText ="The following was issued from " + uidoc.FieldGetText("pic") +Chr(10)+Chr(10)_          
     + "   <Subject>  : "+ uidoc.FieldGetText("Subject") + Chr(10) + Chr(10)_
     + "   <Group>  : "+ uidoc.FieldGetText("Group") + Chr(10)_
     + "   <Region>  : "+ uidoc.FieldGetText("Customer") + Chr(10)_
     + "   <Category>  : "+ uidoc.FieldGetText("Category") + Chr(10) + Chr(10)_
     + "   <Contents> : " + Chr(10)  

And debug the script and you can see which line the error comes.
0
 
LVL 19

Accepted Solution

by:
madheeswar earned 30 total points
ID: 11827744
If you have any views, make it a defualt view and test this code.

I Tested your code and it looks OK.
if you don't have any views, then create a view and make it as default.

IGNORE my first post.

THANKS.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
A short film showing how OnPage and Connectwise integration works.
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now