Solved

Best way to have reply emails entered into a Lotus Notes form document

Posted on 2011-09-06
18
269 Views
Last Modified: 2013-12-18
Hello,

I have a ticketing database that I would like to setup so I can email from the ticket and when the user responds to have that information go directly into the ticket. Basically, I would to email directly from the ticket (I am assuming I can create a email form tied to the ticket) and to have thread documented into the ticket.

What would be the best way to accomplish this?

Thanks in advance..
0
Comment
Question by:ajl7519
  • 7
  • 7
  • 4
18 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 36492320
Sending mail is the easiest part, it's no big deal at all.

Receiving mail is a bit more difficult. What's important is that you understand the concepts, and then everything will automatically fall into its place:
- Notes/Domino has the concept of a Mail-in database: any database can be given a mail address
- mails received directly in the database always trigger the necessary agents (either Before or After mail arrived)
- the form used is always the Memo form (it's not a real form, it's just the name in the Form-field)
- the agent can convert the message to a more appropriate document in the database
- the agent can also try to figure out who the sender was, what the original message was (if any), so where the message should be attached
- an example could be the ticket number in the Subject field

Can you translate your problem into the above?
0
 
LVL 11

Expert Comment

by:larsberntrop
ID: 36493955
Additional thoughts:

I would make the responses into response documents to the original ticket.  You can then make them visisble using an embedded view or other means.

You can glean useful tips from the discussion template included with Notes, and don't forget OpenNTF:  It has tons of useful stuff, including a Help application which might save you a lot of work.
0
 
LVL 1

Author Comment

by:ajl7519
ID: 36495683
Well here is what I have for the Submit button. It will generate an email which includes the DocNumber, which is the ticket number. I also have similar emails go out when the ticket is assigned and then closed. The ticket number is generated by a hidden view and is sequential for each ticket. I have the messages being sent from another mail in database.

So what you are saying sjef_bosman is I can have an agent run based on the ticket number as it will be unique? What I would like to do is add an action button that would open up a new email form (I am assuming this could be a response document) for that would go out to the user. From there they would reply and I would need to tie that response document into the ticket?


Sub Click(Source As Button)
	
	Dim continue As Variant
	Dim workspace As New NotesUIWorkspace
	Dim session As New NotesSession
	Dim db As notesdatabase
	Dim maildoc As notesdocument
	Dim Body As NotesRichTextItem
	
	Dim uidoc As NotesUIDocument
	Dim doc As notesdocument
	Set uidoc = workspace.CurrentDocument
	Set doc=uidoc.document
	
	Dim valFields() As String
	Dim valcheck As String
	Redim valFields(6)
	valFields(0) =  "Laptop/Desktop/Blackberry"
	valFields(1) =  "Printer/Scanner/Copier/Fax"
	valFields(2) =  "Lotus Notes/Met Applications/Other Software"
	valFields(3) =  "VPN/Wireless/Connectivity"
	valFields(4) =  "Phone"
	valFields(5) =  "Move"
	valFields(6) =  "Generic Request"
	' loop through each valFields
	Forall xval In valFields
		valcheck = uidoc.FieldGetText("RequestType")
		If valcheck=  xval Then
			Goto Details
			continue = False
			Exit Sub
Details:
			If ( uidoc .FieldGetText( "Details" ) = "" ) Then
				Messagebox( "You must enter details of your request." )
				Call uidoc.GotoField( "Details" )
				continue = False
				Exit Sub
			End If
		End If
	End Forall
	
	Call uidoc.Save
	
     'Send mails:
	Set db=session.currentdatabase
	
	Set maildoc = New NotesDocument( db )
	maildoc.Form = "Memo"
	maildoc.From = doc.Requester(0)
	maildoc.SentBy = doc.Requester(0)
	maildoc.SendTo = "BFGSERVICEDESK"
	maildoc.Subject = "Request "+doc.DocNumber(0)+" submitted."              
	Set Body=New NotesRichTextItem(maildoc,"Body")
	message=  "New service request for "+doc.UserCN(0)
	Call Body.AppendText(message)
	Call Body.AddNewLine(1)
	message1= "Priority: "+doc.Priority(0)
	Call Body.AppendText(message1)
	Call Body.AddNewLine(1)
	message2= "Details: "+doc.Details(0)
	Call Body.AppendText(message2)
	Call Body.AddNewLine(2)
	message3="Please click this link to view this request=========>>"
	Call Body.AppendText(message3)
	Call Body.AppendDocLink(doc,"Please click this link to view this request")
	Call maildoc.Send( False) 
	
	Dim RequestSubmitted As String
	RequestSubmitted = "Your request has been submitted"
	Messagebox RequestSubmitted , MB_OK + MB_ICONINFORMATION, "Submitted"
	
	Call uidoc.Save
	Call uidoc.Close
	
End Sub

Open in new window

0
ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

 
LVL 1

Author Comment

by:ajl7519
ID: 36495937
Also, I see what your saying about the embedded view. I would create the view for the response documents and embed into the ticket. I would then need a way to have view to show only the related documents and I suppose I can have script or formula do that.
0
 
LVL 11

Expert Comment

by:larsberntrop
ID: 36496168
simple:
the embedded view categorizes on the parent id.  in embeded view set show single category using DocumentUNID (==parentID)
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 36496474
I wouldn't use the UNID for that purpose, but the DocNumber, assuming it is unique for every ticket and can have multiple responses. An appropriate view with DocNumber as first column (sorted) will allow you to find your ticket document easily. Instead of generating a DocuNumber based on a view, you could use a code generated by @Unique (see the Help db).

> I have the messages being sent from another mail in database.
That puzzles me. Mails sent from a mail-in database? Am I being picky or was my explanation not clear enough? It is a mail-IN database, meaning that mails can be received by the database. Any database can send mails, there's nothing special about that. To receive mails in a database, you need to create a Mail-In Database document in the server's Address Book.
0
 
LVL 1

Author Comment

by:ajl7519
ID: 36497324
Well, the separate mail-in database was in place before and I was told to continue using. It's basically just a mailbox that handled the tickets. Also, it was requested that I have sequential numbers fro the ticket number (DocNumber).

0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 36497450
Ok. So you could set the ticket database to receive mails. Of course you have to be prepared to get junk mail in there as well...
0
 
LVL 11

Expert Comment

by:larsberntrop
ID: 36497594
Sequential numbers: brr a world of pain. @Unique is actually a pretty good idea.
0
 
LVL 1

Author Comment

by:ajl7519
ID: 36498156
I wanted to use @Unique, but my boss wanted them sequential. I actually got a tip here how to do that. It works pretty well. I haven't had a problem as of yet.

Yes, I could set the ticketing database as mail-in.

Would it be possible to use it the existing way however? Let's say I create a mail form as a response document sent from the Mail-in database. I can tied that response into the view and filter by DocNumber. Would that work?
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 36498926
You have an agent that creates a response in your ticket database when a reply comes in? That would work, yes.

If it were my boss I'd generate those sequential numbers, just for him, but anywhere else I'd use an @Unique id, guaranteed to work even when replicating databases to other servers or clients. The sequential number would then just be that: a number, meaningless.
0
 
LVL 1

Author Comment

by:ajl7519
ID: 36519962
I think finally understand how to get it to work, but only problem I am having is getting the response document generated from the main document to pick up the fields from the main document. Do you need specific code to link the child document to parent document to accomplish this? Is there where I would use the @Unique to link the documents via a view lookup?

Thanks, I appreciated your help (patience) with Lotus. I basically am the only IT person for like 500 people (and I do absolutely everything from phones to computers) and I only have a hour or so a day to work on Lotus development.
0
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 500 total points
ID: 36520066
One hour per day?? As a Jack-of-all-trades, man, you really rock! I've been doing this stuff for over 13 years now (more or less), and I usually need the full 8+ hours per day to make Notes work for me. And you do it in one hour? I'd ask for a huge pay raise!

> only problem I am having is getting the response document generated from the main document...
and if that's your ONLY problem... whew!

> Do you need specific code to link the child document to parent document to accomplish this?
Yes. You first need to know which parent document, then you assemble the response, you copy over the values you need from parent to child, and finally you use MakeResponse to attach the repsonse to the parent. There are two ways to copy data from one document to the other:
- using childdoc.replaceItemValue("field", parentdoc.getItemValue("field"))
- fielditem.CopyItemToDocument(destdoc)

But seriously, if you really have only one hour per day, ask a 3rd party Notes developer to do the developments for you.
0
 
LVL 1

Author Comment

by:ajl7519
ID: 36524454
I got it working. Thanks for you help.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 36526197
I'm truly impressed....
0
 
LVL 1

Author Comment

by:ajl7519
ID: 36526234
This code picks up all the fields when I used the create mail action. Do you see any problems using it?


Sub Click(Source As Button)
	Dim ws As New notesuiworkspace
	Dim uidoc As notesuidocument
	Dim session As New notessession
	Dim db As notesdatabase
	Dim pdoc As notesdocument
	Dim cdoc As notesdocument
	
	Set uidoc = ws.currentdocument
	Set pdoc = uidoc.document
	Set db = session.currentDatabase
	Set cdoc = db.createDocument
	
	cdoc.Form = "Mail" 
	cdoc.MStatus = pdoc.StatusChange(0)
	cdoc.MDocNumber = pdoc.DocNumber(0)
	cdoc.SendTo= pdoc.Requester(0)
	Call cdoc.makeResponse(pdoc)
	Set uidoc = ws.EditDocument(True, cdoc)
End Sub

Open in new window

0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 36526370
Looks good to me but... for this you don't need code at all, it can be done using standard Notes features:
1/ Define the form type as a Response form (1st tab, 3rd line)
2/ Enable "Formulas inherit values from selected document" on the 2nd tab in the Form Properties
0
 
LVL 11

Expert Comment

by:larsberntrop
ID: 36528264
That's why we love Notes!  All the built-ins that save us time!
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
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.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

803 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