Mark email as Filed from Querysend

I have a querysend script sending some emails to a mail in db I want to mark the email as Filed so that I can display an Icon in the view/folder. tried this but it's not working:
Call doc.ReplaceItemValue("Filed","Yes")
            Call doc.Save(True,False)            
padillrrProject CoordinatorAsked:
Who is Participating?
 
Bill-HansonConnect With a Mentor Commented:
Since the 'doc' variable is never defined, I'm surprised that your code doesn't throw an error.

You should try this instead:

Call source.Document.ReplaceItemValue("Filed", "Yes")
Call source.Document.Save(True, False)
0
 
Bill-HansonCommented:
Your code does mark a document as 'Filed' and saves it, but since it's not working, I'll need to see the rest of your code.  You must be updating the wrong document.
0
 
padillrrProject CoordinatorAuthor Commented:
Heres the full code this is in the querrysend of a new email.....I just want to mark this as filed so that it will display an icon in the folder the folder column has formula for that.....
Sub Querysend(Source As Notesuidocument, Continue As Variant)
	'Check preference and Warn if subject is blank for a new memo
	If source.Document.EnableBlankSubject(0) <> "1" Then
		If source.document.Subject(0) = "" Then
			If Messagebox(warnTxt, MB_YESNO + MB_ICONQUESTION, warnTitle ) = IDNO Then 
				vSubjectBlankSend = False
				Source.GoToField("Subject")
				Call source.Refresh
				Call cMemoObject.SetActionInProgress(MEMO_ACTION_NONE)
				Call Source.Document.ReplaceItemValue("SaveOptions","0")
				cMemoObject. SendBlankSubject=False
				continue = False		
				Exit Sub
			Else
				vSubjectBlankSend = True
				cMemoObject. SendBlankSubject=True
			End If
		End If
	End If
	
	If source.Document.HasItem("ActionInProgress") Then
		source.Document.RemoveItem("ActionInProgress")
	End If
	If source.Document.CustomerJob(0) = "To file please select a job here" Then
	Else	
		'Messagebox "Modify Subject"
		CustomerName$ = Trim(Strleft(source.Document.customerjob(0),"-"))
		JobNumber$ = Trim(Strrightback(Strleftback(source.Document.customerjob(0),"|"),":"))
		If Instr(source.Document.subject(0)," [" & JobNumber$ & "]") = 0 Then
			Call source.FieldAppendText("Subject"," [" & JobNumber$ & "]")
		End If
		If Instr(source.Document.EnterBlindCopyTo(0),"jobcorrespondence@mail.com]") = 0 Then
			Call source.FieldAppendText("EnterBlindCopyTo",",JobCorrespondence@mail.com")
		End If
		Call Source.FieldSetText("Customer",CustomerName$)
	End If
End Sub

Open in new window

0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

 
Bill-HansonCommented:
I don't see your original snippet in the code you posted.  In fact, I don't see anything in this code that modifies the 'Filed' field.  Are you sure that you posted the right code?
0
 
padillrrProject CoordinatorAuthor Commented:
Yes I posted the right code from the production version sorry...but I only added these lines:
Call doc.ReplaceItemValue("Filed","Yes")
            Call doc.Save(True,False)            
0
 
padillrrProject CoordinatorAuthor Commented:
Thanks that did it....I should have been looking at source not doc correct?!?!
0
 
Bill-HansonCommented:
>> "I should have been looking at source not doc correct?!?!"

Right.  'Source' is the current front-end doc (form) and 'Source.Document' is the current back-end doc (record).
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.