function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Krish NKrish N 

How to avoid users creating duplicate cases for already created cases by Apex email services

I've set up Apex email services to automate case creation from emails. We have around 25 customers with different locations who sends emails for service request.
Our current process is such that our CSRs have access to service request email address. From that address they create cases from the inbox. Then they move the email to another folder once case is created (to ensure duplicate cases are not created by other users).
With the Email services being set up for the same email address, how do I ensure there are no duplicate cases created by the users for emails processed by Apex? Email service has only been enabled for 10 of our customers.
Arundhati DuttaArundhati Dutta
Hello Krish,
 You can feed the From Address into a hidden field for every record, everytime anybody sends an email it would match the field of every record that if the email address exsist or not, if the From Address matches with the hidden field email address, it Shouldn't create a Case record and send an email.
Please let me know if this works for you.
Regards,
Arundhati Srivastava
Salesforce Consultant
Webkul Software Pvt. Ltd
Krish NKrish N
Hello Arundathi. I've created a checkbox field on 10 customer accounts, I've added a condition in my query that cases should only be created on locations whose account has checkbox checked. 10 of the 25 customers we've, have an individual specific service request template. When they require a service assistance, they would send an email to our service csr email, let's say test@sample.com. I want to ensure those customer emails processed by email services, shouldn't have duplicate cases created by the users who've access to test@sample.com.