[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 386
  • Last Modified:

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)            
0
padillrr
Asked:
padillrr
  • 4
  • 3
1 Solution
 
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
 
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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
 
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
 
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

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now