ShowStopper Problem: DocLink Question

This is hard to explain but I will try my best.

Right now I have a Request Form - you compose this form from within the database.

@Command([Compose];"Request")

Once you have completed your data you send out emails.  The way the script works today - instead of a mail form it sends out OutGoing Request Form to the users inbox.  From this form the users can reply or forward.

==> Send Mail code from the Request Form

mDoc.Form = "Outgoing Request Form"
      mDoc.SourceDocument = doc.UniversalID
      mDoc.SenderList = session.CommonUserName      
      Call mDoc.Send(True)
      Call uiDoc.Close(True)

==>Problem: Outgoing Request Form is very large.  My company limits the size of our inboxs.  
==>Question:  Is there a way to send a doclink to Outgoing Request Form verses sending the form itself?
==>Complete Code Below:  I will post the code I use to send mail.  Problems I see, is that Request Form is a parent document and the UnID gets pastes to the Outgoing Request Form.

Please take a look at this issue and see if there are any ways to help me.

Thanks

Jaziar

JaziarAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Sjef BosmanConnect With a Mentor Groupware ConsultantCommented:
The first thing you have to do??  THINK... :-)  Or get me a job :-P

Okay, let's get the logic straight. What you have to do is imaging any situation that can occur, and play it in your head, or discuss it with some sparring partner: "What if...". Then, write it down, so you have a reference document if you have to adapt something. Usually, the easiest and most straightforward solution is the best.

Summarizing (not knowing your entire application):
- you have a Request form
- you want to send invitations to people
- you want them to respond
- you intend to remind them when they didn't respond
- they can forward invitation to someone else
- the application needs to know that the invitation is forwarded

The following scheme could be used:
* Request-form
    - when created, send a simple mail to the users, with a doclink to invite them to look at the Request
    - to make sure they HAVE to go to the Request document, prevent that the mail is forwarded! (hint: set $KeepPrivate to "2")
    - add two buttons: "Respond" and  "Forward"
    * the Respond-button:
        - check if a Response already exists for this user, if so open it
        - if not, create a new Reponse document, fill the necessary fields, copy the attachments to the Body, save the document and open it
    * the Forward-button:
        - ask to whom the action should be forwarded
        - check if a Response already exists, then either refuse forwarding or reassign the Response to the new user
        - send the user a mail telling him some action is required by him
0
 
Sjef BosmanGroupware ConsultantCommented:
There are no big problems, I think. We'll meet the on the way. You have 2-3 options:

1) You forget about creating the Outgoing Request document (OR-doc) altogether. Instead, you create only a mail with a doclink to the document where you got all information from, I mean the information you copied to the OR-doc. This can only be done if there's no functionality on that form to be used directly from the mail by the recipient AND you can handle everything using the form in the original database. I'd like to know what the options are for the recipient of the OR-doc, what can he do with the form??

2) You create the OR-doc as a response document to the original document. You create an additional mail document that you send to the intended recipient, with only a doclink to the OR-doc. As soon as the activities around the OR-doc are done, the document will have lost its purpose and can be deleted.

3) The same as 2, but you create the OR-doc in a separate database, to keep the central database clean.

Personally, I don't like creating documents that serve a purpose for only a short time. If everything can be done by sending just a mail with a doclink to the real document (not to an OR-doc), the whole process might be a lot cleaner.
0
 
JaziarAuthor Commented:
Let me try to explain how this works and then you can tell me the best route.
                                       
Actions:            Send Mail                                              Reply  / Forward                          Send Reply
                                             sends form to inbox
Form routes:   [Request Form] - - - - - - - - - -- - - - > [Outgoing Request Form] - - - - -> [Response Form] - -|
                              /\                                                                                                                              |
                              |------------------------------------------------------------------------------------------------------
User creates a document and sends it to users - the users get a email in their inbox (open it and it is the OR-doc)
there they can reply (Action opens Response Form) or forward (basically sends the OR-doc to someone else)
when they respond (Response Form) it appends comments to the Request Form

So I dont think 1 will work, 2 might work, and 3 may work.
0
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

 
Sjef BosmanGroupware ConsultantCommented:
Can you explain exactly WHY you need the OR-doc?? I can see HOW you implemented it (or you want it implemented) but there must be some reason behind it that you want to have this OR-doc (in an OR-form). Just suppose you forget all about the forms you already have, and you tell us WHAT you want to achieve.

My guess:
1) You want to send some people a notification
2) You want these people to open the notification and act upon it
3a) They can ignore it, then all hell breaks loose (your nag-mail probably ;)
3b) They can do what they are suppose to do: open the real Request form and take action
3c) They can forward the request to someone else (forget this one, it is some kind of action mentioned in 3b)

Isn't it possible to draw their attention to the Request document itself? With the necessary actions? So:

1) Send a mail from the Request document to the user(s), with a DocLink to that Request document
2) Users follow the doclink and do their thing

Could it be this simple??
0
 
JaziarAuthor Commented:
OK - you may be right, I am not sure

I am using the forms to create somewhat of a discussion thread.

All of the responses are captured in the request document with links - if I open a request document it may look like this

+++++++++++++++++++++++Start of Document+++++++++++++++++++++++++++++++++++

SendTo : Jaziar
Date : 05/05/05
Catergory: Testing System
Restricted Viewing = Yes or No

NagMail = Yes or No
NagDate = 05/09/05

Message : PLease reply to this action


Gathered Replies ------------------------

[] (Jaziar) I got your test

++++++++++++++++++++++++++End of Document+++++++++++++++++++++

If they then click the Link - it takes them to the response document.
If they forward it shows here as well

Gathered Replies ------------------------

Jaziar forwarded to Jaziar
Forward comments: Jaziar please respond to this.
[] (Jaziar) I got it and will respond

So at anytime the creator can see all the actions that has been taken on his request.
Here is a example of what may happen

Vice President of Company = Joe

Joe creates request and sends it to all his managers

+++++++++++++++++++++++Start of Document+++++++++++++++++++++++++++++++++++

SendTo : Bob, Chuck, Bud
Date : 05/05/05
Catergory: Expense Challenge
Restricted Viewing = No

NagMail = Yes
NagDate = 05/09/05

Message : I need to know how much you guys can cut off the budget before my meeting friday


Gathered Replies ------------------------

[] (Bud) I can get about 4k
[] (Chuck) only 1k
[] (Bob) Nope, cant get any

++++++++++++++++++++++++++End of Document+++++++++++++++++++++


these replies are stored in the database and can not be deleted like common email.  They delete out email every 30 days here.  The higher ups needs a way to communicate and save all the responses

I hope this all makes sense
0
 
JaziarAuthor Commented:
Give it some thought - Im heading home for the weekend

Thanks
0
 
Sjef BosmanGroupware ConsultantCommented:
I gave it some thought, you as well? I think you only have to send a document with form when the form really contains functionality that is essential to the working of the whole application. If not, then first try to do it without a doc-with-form. Send a mail with a doclink, if necessary every day, and urge the user to do what he's supposed to do: pressing buttons on the linked document. If these buttons are just programmed on the Request form, you can log all activities on that form. You can even log PostOpen events if you want to.
0
 
JaziarAuthor Commented:
The Outgoing Request Form is the only form that is mailed out and I agree with you that there is no need to send the form out.  It would great if we could send out a email with a doclink to the Outgoing Request Form.  I think we have to keep the Outgoing Request Form because of the forwarding Action coded on it.  

Is it possible to send a email with a doclink to the Outgoing Request Form or can you only send a link to the parent document - which is created in the Request Form?
0
 
Sjef BosmanGroupware ConsultantCommented:
Yes, but that's beside my point. Why oh why do you need the OR-form??? That's what I don't understand. What I do understand is that people aren't supposed to do anything with the OR-form, since all activity will happen on the Request-form. Or am I (terribly) mistaken??
0
 
Sjef BosmanGroupware ConsultantCommented:
I mean (since the very beginning): why don't you have an Outgoing Request mail, with a doclink to the Request form?
0
 
JaziarAuthor Commented:
Becuase after the request form is created - the responding users never go back to that form.  The OR-Form takes them to the response form.  The response form is where the users type in data and it saves as a response to the Request form.  In my mind I think that the OR-Form passes values to the Response Form and has the forwardind action coded in it.  I see your point of why we may not need the OR-Form.  During the send action on the request form we would need to pass all the values from the Request Form to the Response Form, I could move the forwarding code to the Response Form.  Would you like to see all the scripts I have on the OR-Form?  I can paste them and where they are.  It may make things much simpler removing this form.  

The email with the doclink would need to point at the Response form and not the Request form is that problem?
0
 
Sjef BosmanGroupware ConsultantCommented:
The latter would be my suggestion, yes: send a simple yet complete mail to the users, with a doclink to tell them where to find the Request document.  Why should users never go back to the Request-document? You can save responses to the Request-document in almost the same way: use buttons on that form for the necessary actions. It seems such a lot of double work...

Can't you solve everything by using the following techniques:
- as soon as the Request document is created, a mail is sent to the people mentioned in it, with a doclink to the Request document
- when a user clicks the link, he opens the Request document for read
- modifying of the Request isn't possible (I assume)
- using buttons, he can execute actions on the Request or on a Response
- a button opens a DialogBox , that asks for info, checks it all and does the hanky-panky
- response docs are therefore created by the logic in these buttons
- the Request document stays the centrepiece of your activities
0
 
JaziarAuthor Commented:
The only problem with the logic is - there can multiple people responding to the document with specefic attachments.  Example would be if the requester sent out a email(Request Form) with a spreadsheet.  Each user then had to open the spreadsheet get the information that is important to them and make calculations and respond with there data.  So each user would have a comment and a attachment.  The creator needs to know what attachment goes with who and what they had to input.  Thats the reason I use the doclinks to the requesters documents in the Request Form.  Then the creator can pick any of the links and respond to the responder.  I think it would be hard to store all this information on the one form.  You would have to append everything in one field and I am not how how we would address the attachments.  I would really like just to try and get a doclink to the OR-Form in the emails -that way I don't have to stop the users from working and reprogram the forms.  I think your input is great - I wish I had talked with you when I was first putting the database together.  I know there is a lot of room for improvement.
0
 
Sjef BosmanGroupware ConsultantCommented:
I get your points. Very valid indeed.

To continue my idea, you could make each answer to a request a separate response, with its own RichText field to store the attachment. You can store the creator of the Response (of course) and all other data required. It'll work, I'm sure of that.

I have some questions (what?! more questions?) regarding the processing of the OR-documents. What did you have in mind to do with them, where would they have been sent back to? A mail-in database? Is possible, yes... But not very practical. Why send a letter in a 40' container??

So suppose now you want to send a mail with a link to an OR-document. Will all users receive the same mail, i.e. with the same doclink? Or do you intend to create separate OR-documents for each user? But all users need a separate document (as you stated), so you could just as well let them create the document themselves, from the Request-form when it is displayed.

So you can send either a doclink to 1 Request-document or to n OR-documents.
0
 
JaziarAuthor Commented:
Please ask all the questions you like - I only wish I could explain better.

1.you could make each answer to a request a separate response, with its own RichText field to store the attachment.

We would have to have a static number of RichText Fields on the form, there could be 1 response or 20.  I dont see how we can capture all the response on one form.

2.  OR-documents. What did you have in mind to do with them, where would they have been sent back to? A mail-in database?

Basically the user hits starts a action on the OR-Form either reply action(opens the Response Form) or Foward (sends the OR-Form to the next user) this contiues until some replies from the Response Form.  So basically the OR-Form sits in a inbox until deleted.

3. Why send a letter in a 40' container??

Agree

4. So suppose now you want to send a mail with a link to an OR-document

I was thinking (first mistake) In the mail send in the Request Form

Sub Click(Source As Button)
      Dim ws As New NotesUIWorkspace
      Dim session As New NotesSession
      Dim db As NotesDatabase
      Dim uiDoc As NotesUIDocument
      Dim doc As NotesDocument
      Dim mDoc As NotesDocument
      
      Set uiDoc = ws.CurrentDocument
      Call uiDoc.Save
      Set doc = uiDoc.Document
      Set db = session.CurrentDatabase
      Set mDoc = New NotesDocument(db)
      If doc.NagMail(0) = "Yes" Then
            Set item = Doc.ReplaceItemValue("NagList", Doc.SendTo)
      End If
      If doc.ViewBy(0) = "Viewing Restricted (To: Recipients Only)" Then
            Set item= Doc.ReplaceItemValue("DocReaders", Doc.SendTo)
            Call item.AppendToTextList(session.UserName)
      End If
      
      doc.CreateFlag = No      
      'Set db = session.CurrentDatabase
      'Set mDoc = New NotesDocument(db)
      
      Call doc.CopyAllItems(mDoc)      
      If doc.ViewBy(0) = "No Restrictions (All)" Then
            Set item = mDoc.GetFirstItem("DocReaders")
            Call item.AppendToTextList(mDoc.SendTo)
            Call item.AppendToTextList(session.UserName)
      End If
      mDoc.Form = "Outgoing Request Form"
      mDoc.SourceDocument = doc.UniversalID
      mDoc.SenderList = session.CommonUserName      
      Call mDoc.Send(True)
      Call uiDoc.Close(True)
      
End Sub

It would still do the same actions with the exception of mDoc.Form = "Outgoing Request Form"
We could somehow just doclink to the Form Instead of Mailing.  When the user clicked the link it would take them to the OR-Form (that has all the information there from the send action)
So basically everyone in the SendTo Field gets the same doclink.

Here is the Reply Action in OR-Form

Sub Click(Source As Button)
      Dim session As New NotesSession
      Dim ws As New NotesUIWorkspace
      Dim db As NotesDatabase
      Dim thisUIDoc As NotesUIDocument
      Dim uiDoc As NotesUIDocument
      Dim doc As NotesDocument
      Dim nDoc As NotesDocument
      Dim sDoc As NotesDocument
      Dim strServer As String
      Dim strFilename As String
      
      Set thisUIDoc = ws.CurrentDocument
      Set doc = thisUIDoc.Document
      strServer = doc.DatabaseServer(0)
      strFilename = doc.DatabaseName(0)
      
      Set db = New NotesDatabase(strServer, strFilename)
      If Not(db.IsOpen) Then
            Call db.Open("", "")
      End If
      
      Set sDoc = db.GetDocumentByUNID(doc.SourceDocument(0))
      Set nDoc = New NotesDocument(db)
      
      Call nDoc.MakeResponse(sDoc)
      nDoc.Subject = doc.Subject(0)      
      nDoc.ServerReaders = doc.ServerReaders(0)
      nDoc.BossReaders = doc.BossReaders(0)
      nDoc.DocReaders = doc.DocReaders
      nDoc.RequestSecurity = doc.RequestSecurity(0)      
      nDoc.RequestRequester = doc.RequestRequester(0)
      nDoc.RequestDate = doc.RequestDate(0)
      nDoc.Message = doc.PoopMessage(0)
      nDoc.Form = "Response Form"
      nDoc.Creator = session.CommonUserName
      nDoc.SendTo = session.UserName
      nDoc.SourceDocument = doc.SourceDocument(0)      
      Set uiDoc = ws.EditDocument(True, nDoc)
      Call thisUIDoc.Close(True)
End Sub

This is the Forward Action in the OR-Form

Sub Click(Source As Button)
      Dim ws As New NotesUIWorkspace
      Dim db As NotesDatabase
      Dim uiDoc As NotesUIDocument
      Dim thisDoc As NotesDocument
      Dim newDoc As NotesDocument
      Dim varNewTo As Variant
      Dim item As NotesItem
      Dim session As New NotesSession
      Dim view As NotesView
      Dim pDoc As NotesDocument
      Dim strServer As String
      Dim strFilename As String
      Dim rtItem As NotesRichTextItem
      Set uiDoc = ws.CurrentDocument
      Set thisDoc = uiDoc.Document
      Set db = thisDoc.ParentDatabase
      Dim strToName As String
      Set newDoc = New NotesDocument(db)
      Call thisDoc.CopyAllItems(newDoc, True)
      varNewTo = ws.PickListStrings(PICKLIST_NAMES, True)
      Set item= newDoc.GetFirstItem("DocReaders")
      Call item.AppendToTextList(varNewTo)
      item.isreaders = True
      k = Inputbox("Enter your comments")      
      Set item = newDoc.GetFirstItem("SendTo")
      item.Values = varNewTo
     'newDoc.SenderList = "Forwarded by " & session.CommonUserName & Chr$(13) & newDoc.SenderList(0)
      newDoc.Subject = "Fw: " & thisDoc.Subject(0)    
      newDoc.FowardComments = k      
      Call newDoc.Send(True)
  ' Now, put a note in the original database indicating that the document was forwarded.
      strServer = thisDoc.DatabaseServer(0)
      strFilename = thisDoc.DatabaseName(0)
      
      Set db = New NotesDatabase(strServer, strFilename)
      Set view = db.GetView("2005\Actions")
      Set pDoc = db.GetDocumentByUNID(thisDoc.SourceDocument(0))
      Set rtItem = pDoc.GetFirstItem("Comments")
      strToName = StringReplace(item.Text, "CN=", "")
      strToName = StringReplace(strToName, "/OU=Lex/O=Company
      Call rtItem.AppendText("Forwarded to " & strToName & " by " & session.CommonUserName)
      Call rtItem.AddNewLine(1)
      Call rtitem.appendtext("Forwarded Comment:  " & k)
      Call rtItem.AddNewLine(1)
      Call pDoc.Save(True, False)
      Call uiDoc.Close(True)
End Sub


The OR-Form seems only to be a large email form.  Could we send a doclink to the Response form and from there they could reply or Forward?
0
 
Sjef BosmanGroupware ConsultantCommented:
Re 1. Sorry, I didn't mean to store everything in one document. Make a response document for every reaction from a user, so they all have their own single rich-text field. Technically, you could have a document with many rich-text items, there's o limit (or a very large one) to the number of NotesItems in a document. The problem would be to represent all these fields in a form. Even that can be done, but it's not easy and rather laborious. So I'd prefer one response document per reaction, let's call it a Request Response document.

Re 2. But the OR-document is in fact in a mail database. The lifeline with the original database is cut, so you have to provide the necessary mechanisms to open the original database and create some document there. Does this already work? Is the OR-document in the Inbox ever modified, or serves it only as a presentation of the data with some buttons for actions?

Re 3. :)

Re 4. That answers part of my question indeed: you create a new Response Form when replying. But couldn't you have the Reply-action button on the Request form? The logic of the button's LotusScript would be almost the same, you just don't have to open the database for it is the current database then. Again, what is the purpose of sending doc-with-form? Maybe I have to read on first... Ah, the Forward action, it does something with the Request document. Looks dirty, you might (better: will) get replication conflicts when your database is replicated to multiple servers and/or workstations. It might be better to add a Forwarded Form as a response document, with some information on it. When closing the request, you could put the history information of these Forwarded Forms and other forms into one field, and then throw away the Forwarded Forms.

So the only reason I see to keep the OR-document is the logging of the Forward action, which cannot be done from a simple mail. But, you could also make a forward action on the Request-form, that would do practically the same as your action.

Somehow I still fail to see the implications of sending the OR-document with the OR-form included. Is the user expected to UPDATE the mail, is he to put or modify an attachment in the mail itself?
0
 
watsoncaCommented:
sendTo := @Unique(@Explode(@Implode (ListAreaGroup; ","); ","; @False));
copyTo := "";
blind := "";
subject := "this is an e-mail" + ChangeNbr;
remark := "this is an e-mail " + ChangeNbr;
bodyFields := @NewLine + @NewLine + "DocLink-->"; "";

@MailSend( sendTo ; copyTo ; blind ; subject ; remark ; bodyFields; [IncludeDoclink]);
Prompt := @Prompt([Ok]; "Mail Notification"; "Mail has been sent to the Area Group"; ""; "")

I'm kind of doing the same thing you are. I need to get 3 peoples approval on a from and I do this by checking the approver field. based on the status of the field I hide the button, Much easier!
0
 
JaziarAuthor Commented:
watsonca - nice to meet you.

The problem I am having is that the script is sending a form to the inbox.  The form is very large so the inbox gets big.  I was wanting to send a doclink to the form (not the same form the action runs in) so that they user can click the doclink and take them to the form that was first in the Inbox - Clear as mud?
0
 
watsoncaCommented:
Nice to meet you too :-)

yep, that's what this code does. it sends a doclink to the form. It creates an e-amail with a doclink, from my experance, and e-mail with a docklink runs around the size of 1087 - 1100.
0
 
JaziarAuthor Commented:
Let me try to explain a little better

Form 1 - - > []  
                    |    User creates a document and sends email to the users in the SendTo
                    |    The Email is basically OR-Form mDoc.Form = "Outgoing Request Form"
          |                                                   mDoc.SourceDocument = doc.UniversalID
          |                                                   mDoc.SenderList = session.CommonUserName      
          |                                                   Call mDoc.Send(True)
OR-Form- -> []<---- | InBox
                    |         |
                --------     |
               |         |---
Form 3 ->[]       Foward        From The OR-Form you can reply which takes you to Form 3 or you can forward the OR-                                           Form.  Each response from Form 3 is a response Document to Form 1
                                           I need to send a doclink to the OR-Form instead of sending the OR-Form
0
 
Sjef BosmanGroupware ConsultantCommented:
Hi Watsonca,

Please read the whole question, including the comments. It is NOT about sending a doclink, it is about finding the right way to get several people to take some action. The Request-form is created, in it are the names of people who should react. These people get a mail based on an Outgoing Request form, including the form. They are supposed to use that form to take some actions in the database where the original Request is stored. In that way, all actions done on behalf of the Request can be monitored.

Sending a mail with a form creates a very large mail document. The form is required because there is some functionality in that form: buttons etc. The question is how to create a much simpler email, just text but with a doclink, instead of the large one. What provisions have to be made in the application to make this work? What is the doclink supposed to be referencing?

Please correct me if I'm wrong, Jaziar...

My suggestion is to send a mail with a doclink to the Request, and not to any other document. The Request should be equipped with the necessary functionality (additional buttons) to handle user actions by a user, like a response or a forward. The result of a response could be a response-document (in the Notes-sense) containing a rich-text field with an attachment. The result could also be a much smaller comment that the action has been forwarded to somebody else.

Jaziar, if you think it all over, you can agree with me that the above is a solution to your problem, and you can also see that your method is much more complex or even too complex to make it work, then I'd say that it's better to turn halfway and rethink your application's logic.
0
 
JaziarAuthor Commented:
I agree that I need to change something for sure.  What if we send a doclink to the response form and just cut out the OR-Form?
0
 
Sjef BosmanGroupware ConsultantCommented:
Would that mean that you have to prepare an empty response document for every user who has to respond? What if a user forwards his mail? How about the necessary rights on the already prepared response doc?

Isn't it just as easy to prepare a simple response document when they push the "Create Response"-button on the Request form? What you'd have to do is:
- include the attachment in the response's document, save it and open it for editing
- if they already created a response, don't create a new one but just open that response
0
 
JaziarAuthor Commented:
Bosman you have sold me.  But I am going to need your help to walk me through this.  

What is the first thing I need to do?    
0
 
riprowanCommented:
Sjef is absolutely correct.  Notes workflow applications work best by bringing people to the application, not by emailing the application to the people.

Jazair - to rethink your problem, first, forget completely about your solution.  Now, forget entirely about the need to notify people.  Instead imagine that you are building a shared application that works completely without any notification.  Build that application.  Once you understand what that application does, THEN look at bolting on some notification logic to bring people to the application.

This is the "Correct" model of Notes application development.
0
 
riprowanCommented:
I also agree with Sjef that you should just give him a job  ;)
0
 
Sjef BosmanGroupware ConsultantCommented:
One small problem... It's probably an existing application that's built incorrectly, lacking the "forget"-features you would have liked.

Sjef  :)
0
All Courses

From novice to tech pro — start learning today.