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)            
padillrrIT DirectorAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
padillrrIT  DirectorAuthor 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
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
PMI ACP® Project Management

Prepare for the PMI Agile Certified Practitioner (PMI-ACP)® exam, which formally recognizes your knowledge of agile principles and your skill with agile techniques.

padillrrIT  DirectorAuthor 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
Bill-HansonCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
padillrrIT  DirectorAuthor 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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.