How can I prevent a Case record from being created?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lj4353
    Senior Member
    • Nov 2023
    • 160

    #1

    How can I prevent a Case record from being created?

    Click image for larger version

Name:	image.png
Views:	0
Size:	150.3 KB
ID:	123308
    I enabled the "Create Case from Email" feature, but I receive many duplicate emails every day. I want to block the Case creation when the incoming email is a duplicate.

    I tried adding the following line in Before Save Custom Script:
    throw("Duplicate record detected. Creation prevented.");
    However, this does not prevent the Case from being created.

    How should I properly block the creation of a Case record (including those created from inbound emails)?
    Which script or formula should I modify, and where should I place the logic?

    Any advice would be appreciated.
  • heint
    Member
    • Jun 2025
    • 50

    #2
    Greetings, lj4353,

    I assume that this link can be helpful for you: https://docs.espocrm.com/development/duplicate-check/.

    Comment

    • heint
      Member
      • Jun 2025
      • 50

      #3
      Since working with the "Create Case" functionality of IMAP can be kind of confusing, you can also create the following workflow:

      Click image for larger version

Name:	image.png
Views:	0
Size:	48.6 KB
ID:	123362
      which will detect duplicate cases by name and delete them. You can configure the workflow in a way to send a pop-up notification after duplicate records have been deleted.

      By default, you will get the following notification from the system:

      Click image for larger version

Name:	image.png
Views:	0
Size:	11.2 KB
ID:	123363

      Comment

      Working...