Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 327
  • Last Modified:

Unable to send document link to email account

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
kopibean
Asked:
kopibean
  • 2
1 Solution
 
madheeswarCommented:
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
 
madheeswarCommented:
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now