[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Doclink to other document

Posted on 2004-10-29
17
Medium Priority
?
362 Views
Last Modified: 2013-12-18
Hello All,
I always have interesting things going on......
Here I'm creating a document that when a submit button is pressed, it takes numerous fields off the document and generates a different document using a different form and then sends an automated email contacting the receiver of the other generated document that one has been created and is pending his review.  In the email Iwant to have a doclink to the new background document created, not the main document.  
Let me give you some business background on this function to clarify.
The main form is a detailed job run documnet that outlines everything you need to know about a particular job.  In this form there are fields outining file specs.  The auto created form creates a file form and sends it to a person that is reponsible for creating the file specs.  so the email needs to doclink to new file form not the main.
hope this makes sense.
Thanks !
Paul
0
Comment
Question by:pratigan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 8
17 Comments
 
LVL 14

Expert Comment

by:p_partha
ID: 12447852
You have to use appenddoclink method of notesrichtextitem class
  Call rtitem.AppendDocLink( doc, db.Title )

doc can be any document(in your case the document created on teh fly)

Partha
0
 
LVL 4

Author Comment

by:pratigan
ID: 12447896
Hello Partha,
HOw do I identify my document on the fly ??
0
 
LVL 14

Expert Comment

by:p_partha
ID: 12447915
how are you creating the documnet , it should be in webquerysave or querysave(if it's notes client). In that you will anyways have the handle to the new documnet, use that in your mail memo code

Partha
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Author Comment

by:pratigan
ID: 12447962
here is the code that creates the "on the fly form"
Sub Querysave(Source As Notesuidocument, Continue As Variant)
      Dim ss As New notessession
      Dim db As notesdatabase
      Dim ws As New NotesUIWorkspace
      Dim uidoc As notesuidocument
      Dim doc As notesdocument
      Dim backendDoc As NotesDocument
      Set db = ss.CurrentDatabase
      Set uidoc = ws.CurrentDocument
      Set backendDoc = uidoc.Document
      Dim success As Variant
      Dim freqWrd As Variant
      Dim inputbx As Variant
      '************************************************************
      '   Flags set to New .... Create new request forms
      '************************************************************
      If (backendDoc.prod_cklst_mobius_flag(0) = "New" And backendDoc.rpt1(0) <> "" And backendDoc.Status(0) = "Submitted") Then       
            Set doc = db.CreateDocument
            doc.Form = "ORRform"
            doc.ORdate_req_prod = backendDoc.Prod_Dt(0)
            doc.ORrequest = backendDoc.DisplayAuthor(0)
            doc.ORtype = backendDoc.Prod_cklst_mobius_flag(0)
            doc.ORjob_nme = backendDoc.jclmember(0)
            doc.ORappl = backendDoc.Subsystem(0)
            doc.ORdesc = backendDoc.rpt1(0)
            doc.ORrpt = backendDoc.rpt1_rpt_ID(0)
            doc.ORwriter = backendDoc.rpt1_wrtr_nam(0)
            doc.ORfreq = Mid(backendDoc.jclmember(0), 4, 1)
            freqWrd = Mid(backendDoc.jclmember(0), 4, 1)
            
            Dim view As NotesView
            Set view= db.getview("(ORreq)")
            Set vdoc= view.getfirstdocument
            If vdoc Is Nothing Then
                  doc.ORreq= 1
            Else
                  doc.ORreq= vdoc.ORreq(0) + 1
            End If
            
            If freqWrd = "D" Then
                  doc.ORfreq = "Daily"
            Elseif freqWrd = "W" Then
                  doc.ORfreq = "Weekly"
            Elseif freqWrd = "M" Then
                  doc.ORfreq = "Monthly"
            End If
            success = doc.ComputeWithForm( False, False )
            
            If success Then
                  Call doc.Save( True, False )
                  backendDoc.prod_cklst_mobius_flag = ""
                  Call backendDoc.Save(True,False)
            End If
      End If      
0
 
LVL 14

Expert Comment

by:p_partha
ID: 12447974
doc is the new document, send this document as parameter to the mail generation functoin..or paste that function , i will try to help you out

Partha
0
 
LVL 4

Author Comment

by:pratigan
ID: 12448011
The mail function is initiated when the submit button is pressed.
Prod_cklst_mobius_flag != "";
@MailSend("Paul R Ratigan/CIV/CSC"; "";"";"Mobius Rpt Request has been processed and is Pending your Review.";"";"Mobius Request Doc Link =>  "; [IncludeDoclink]);"");
0
 
LVL 14

Expert Comment

by:p_partha
ID: 12448122
@mailsend as far as i know you cannot use any other document link apart from ur current document, so ideally you have to put your mailsend code in lotusscript querysave itself.

something in this lines:

declare your doc globally and change your if condition to

 If success Then
              Call doc.Save( True, False )
call Processmail(doc)


              backendDoc.prod_cklst_mobius_flag = ""
              Call backendDoc.Save(True,False)
         End If


Add a new function

function processmail(doclink as notesdocument)
Dim maildoc As notesdocument
      Set maildoc = db.createdocument
      Dim rtitem As NotesRichTextItem
      Set rtitem = New NotesRichTextItem ( maildoc, "Body" )
      maildoc.form="memo"
      maildoc.sendto = "Paul R Ratigan/CIV/CSC"
Call rtitem.AppendDocLink ( doclink, "doclink" )
maildoc.subject = "test"
      Call maildoc.send(False)
end function
0
 
LVL 4

Author Comment

by:pratigan
ID: 12462473
Helo Partha,
That's excellent.  I'm coding that in right now and I'll be testing it this morning.  I'll let you know how I make out.
Thank You !!!
paul
0
 
LVL 4

Author Comment

by:pratigan
ID: 12463762
Hello Partha,
I'm gettting an error:  Variant does not contain an object on line:
      Set maildoc = db.createdocument
0
 
LVL 14

Expert Comment

by:p_partha
ID: 12463777
Hey paul
Make sure db is pointing to the current database, if it is then declare it globally

Partha
0
 
LVL 4

Author Comment

by:pratigan
ID: 12463819
     Set db = ss.CurrentDatabase
This is setup already in the beginning of the Querysave section.
0
 
LVL 14

Accepted Solution

by:
p_partha earned 500 total points
ID: 12463854
I meant declaration..

go to form global and there put this line:

  Dim db As notesdatabase

or u can try this:

function processmail(doclink as notesdocument)
dim session as new notessession
dim db as notesdatabase
set db = session.currentdatabase
Dim maildoc As notesdocument
    Set maildoc = db.createdocument
    Dim rtitem As NotesRichTextItem
    Set rtitem = New NotesRichTextItem ( maildoc, "Body" )
    maildoc.form="memo"
    maildoc.sendto = "Paul R Ratigan/CIV/CSC"
Call rtitem.AppendDocLink ( doclink, "doclink" )
maildoc.subject = "test"
    Call maildoc.send(False)
end function
0
 
LVL 4

Author Comment

by:pratigan
ID: 12464334
Hello Partha,
Got it working..... Excellent.
Is there a way to have a message before or after the doclink in the body of the email instead of just the actual doclink.  I tried adding this:
      maildoc.body = "Mobius Request Doc Link => "
to the function to put a message indicating the link but when it generated the email, this message appeared but the doclink was no longer there.???
Thanks !

0
 
LVL 14

Expert Comment

by:p_partha
ID: 12464349
Call rtitem.Appendtext ("this is just a test message for paul")

Call rtitem.AppendDocLink ( doclink, "doclink" )

Partha
0
 
LVL 4

Author Comment

by:pratigan
ID: 12464454
Awesome..... worked like a Charm.  
Thank you Very Much.
I totally Appreciate Your Help !!
0
 
LVL 14

Expert Comment

by:p_partha
ID: 12464564
Thx for the points :)

btw you can even try this:

 Call rtitem.Appendtext ("this is just a test message for paul")
  Call rtitem.AddNewLine( 1 ) ' this is just to add a new line
Call rtitem.AppendDocLink ( doclink, "doclink" )

Partha
0
 
LVL 4

Author Comment

by:pratigan
ID: 12464698
Excellenet... That helps make the body neater.
Thank you !!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

649 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