Skip to main content
Answer

Clear Email Queue

  • June 30, 2022
  • 6 replies
  • 720 views

cmoreland
Semi-Pro III
Forum|alt.badge.img

Is there a good way to clear out the messages in the email queue? We have a ton of garbage messages I would like to just delete. 

Best answer by hkabiri

@cmoreland 

You have two options:

  1. Delete emails using All Emails Screen and select and click on Trash Can which mark them as Deleted and you may need to redo for Deleted Status emails to completely delete them from UI
  2. Use SQL script and delete from SMEmail Table with condition you specify

Problem with 1st option is, in case these emails have attached files, the attached files may remain on DB and not deleted.

 

 

6 replies

hkabiri
Acumatica Moderator
Forum|alt.badge.img+8
  • Acumatica Support Team
  • Answer
  • July 1, 2022

@cmoreland 

You have two options:

  1. Delete emails using All Emails Screen and select and click on Trash Can which mark them as Deleted and you may need to redo for Deleted Status emails to completely delete them from UI
  2. Use SQL script and delete from SMEmail Table with condition you specify

Problem with 1st option is, in case these emails have attached files, the attached files may remain on DB and not deleted.

 

 


Ahmed
Varsity II
Forum|alt.badge.img+1
  • Varsity II
  • July 2, 2022

I think Sam meant option #2 is the one that attached files would remain on the DB (unless a separate SQL query was included for deleting corresponding rows 1st).

I recommend #1 using a keyboard-mouse macro writer (like AutoHotkey).


Forum|alt.badge.img+6
  • Captain II
  • May 18, 2023

@hkabiri  Hello expert, I happened to find, even if I click twice delete on All emails screen, these records are still kept in DB.  How is that, any suggestion?

 

 


Forum|alt.badge.img+6
  • Captain II
  • May 23, 2023

@Ahmed  Hello,did you find that even if we click twice on screen, these email data are just mark as deletedrecord=1 and not acutally be cleaned.


Forum|alt.badge.img
  • Jr Varsity III
  • December 12, 2023

I believe (still testing/confirming) these 4 scripts will delete emails based on CreatedDate and all associated attachments.

delete UploadFileRevision
from SMEmail
left join NoteDoc
on SMEmail.CompanyID = NoteDoc.CompanyID and
   SMEmail.RefNoteID = NoteDoc.NoteID
left join UploadFile
on NoteDoc.CompanyID = UploadFile.CompanyID and
   NoteDoc.FileID = UploadFile.FileID
left join UploadFileRevision 
on UploadFile.CompanyID = UploadFileRevision.CompanyID and
   UploadFile.FileID = UploadFileRevision.FileID
Where SMEmail.CreatedDateTime < '2023/06/01' and
    uploadfilerevision.CompanyID is not null

delete UploadFile
from SMEmail
left join NoteDoc
on SMEmail.CompanyID = NoteDoc.CompanyID and
   SMEmail.RefNoteID = NoteDoc.NoteID
left join UploadFile
on NoteDoc.CompanyID = UploadFile.CompanyID and
   NoteDoc.FileID = UploadFile.FileID
Where SMEmail.CreatedDateTime < '2023/06/01' and
    uploadfile.CompanyID is not null

delete NoteDoc
from SMEmail
left join NoteDoc
on SMEmail.CompanyID = NoteDoc.CompanyID and
   SMEmail.RefNoteID = NoteDoc.NoteID
Where SMEmail.CreatedDateTime < '2023/06/01' and
    notedoc.CompanyID is not null

delete SMEmail
from SMEmail
Where SMEmail.CreatedDateTime < '2023/06/01'


Forum|alt.badge.img+1
  • Jr Varsity II
  • October 29, 2024

I’ve heard horror stories from using scripts like these.

We need Acumatica to address this issue. It’s been YEARS.