17

Yes. The Salesforce dev guide has a bunch of String methods for this kind of stuff. https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm Methods of interest are: isAlpha() isAlphanumeric() isNumeric()


9

The EmailMessage object ParentId is exclusive to Cases (at least based on current Salesforce schema information). You can always branch your code to inspect the ParentId with the Case object prefix value (500). To my knowledge, your solution of adding a trigger on EmailMessage is the only viable solution.


8

Actually, you can do this using a workflow (although it depends on exactly what you are doing). My goal was to have a time/date field that got updated when an a case received an email, as a way to keep cases current in the list (since normally the date doesn't change). You can also take advantage of this to re-open cases automatically when an email is ...


6

There are a number of ways records can be inserted into objects. Use of DML via Apex through your own code is of course one. Here you can of course determine how many records are inserted at once. However the Force.com platform is a very open platform. There are numerous API's (Enterprise, Partner, REST) and also Data Loader tools (utilising these API's) ...


6

Controlling e-mail to case is perfectly possible, but does require a level of Salesforce development knowledge/experience. The easiest way is first, make sure you assign a Case Origin specific to e-mail to case (which I hope is basically standard practice) With that in place, you can create a Trigger on case, for a before insert action, similar to this, to ...


6

You will need to update the email forward for Email-to-Case to the new email when you setup the email address in Sandbox. The addresses are different in the two environments. The test email is sent to your email address during setup. The email address you are forwarding to [your email prefix}@"".Case.Salesforce.com is the address that is creating the case.


6

What Brian is trying to tell you is that there are different email addresses for Production and for Sandbox Email to Case. Cases are being created in Production because you are using a production email to case address. You need to actually create a completely different email to case address in your sandbox and use that one to test. Then when you go live in ...


6

Sethu From the doc on the page: Define email addresses on your email system for case submissions. Create email routing addresses that include the addresses defined for cases. Configure your email system to forward case submissions to the Email Services Address provided to you by Salesforce. Basically, the EmailAddress field is the email address your ...


6

Following trigger parses case description for base64 images and creates attachments for case. Email-to-Case functionality stores email body in case description. Let's assume we have next html: <html> <head> <title>Base64 image</title> <h5>How to store (or ignore) Base64 images in emails processed by email-to-...


5

You can write trigger on attachment from the Developer console or the Eclipse IDE. See here for more information: http://help.sfdcdro.com/apex/HTViewSolution?id=000181538&language=en_US If you want to get this on UI try the below hack: locate entity query string parameter in the URL when creating a new trigger on any object (e.g. entity=Case) and ...


5

Rather than creating "dummy" record types, which seems like a heavy handed way to identify the different incoming Email2case types, why don't you add different case origins to the picklist, and set three of these? If you navigate to Customize > Cases > Fields > Case Origin you could then add three new values to the picklist Refund X Refund XY Refund XYZ ...


5

This information is not stored in a field but it can easily be calculated in a formula or in Apex. Formula: "ref:_00D" & MID(Id,4,1) & "0" & RIGHT($Organization.Id, 4) & "._" & LEFT(Id,4) & "0" & RIGHT(Id,5) & ":ref" Apex: public static String ThreadId(String caseid) { string Case_ThreadID = '_' + UserInfo....


5

You can do this using nothing but configuration via the Process Builder. Step 1: Create Timer Field On the Case object, create a date time field with no default value. Step 2: Create Process 1 In Process Builder, on the Email Message object, when the message is outgoing, update the parent case's Status to Waiting on Customer, and the Date Time field to ...


5

Let's say, Email-to-Case set up is like this: And user is sending single email to both the address bc@outlook.com and abc1@outlook.com. So, there are 2 cases will be created and you if see any one of the Email messages, you will find To Address as bc@outlook.com;abc1@outlook.com Though for both the Email Messages Parent Ids are different. I could find ...


5

No, the email service addresses for email-to-case will not change. The org I work in now has My Domain, and a bunch of old email-to-case addresses that still work. (In fact, in checking, I realized that many of them have our old pod (na5) in them, even though we are now on a different one.)


5

The running user for Email to Case is found in Setup | Customize | Cases | Support Settings under the field Automated Case User if you are using On-Demand E2C The user listed in the Case History related list for automated case changes from: • Assignment rules • Escalation rules • On-Demand Email-to-Case • Cases logged in the Self-Service ...


4

If you can differentiate the types of cases via which email address the email was sent to, you could query the EmailMessage object to figure this out. Let's say the cases you're interested in are all sent to yourteam@company.com. Then something like this in your case insert trigger should work: Case theCase = Trigger.New[0]; EmailMessage msg = [select Id, ...


4

Yes. Assuming you can forward a mailbox, you can do this with very little code. Enable Email-to-Case (On-Demand) with a Routing Addresses if you haven't already, Setup > Customize > Cases > Email Messages > Triggers, Create a new trigger; here's an example to get you started: trigger InboundCaseComment on EmailMessage (before insert) { List<...


4

You should be able to create an instance of your class that implements Messaging.InboundEmailHandler in the test method and then pass it a Messaging.InboundEmail and Messaging.InboundEnvelope. This will create the Case and associate it with the email. E.g. global class EmailToCaseHandler implements Messaging.inboundEmailHandler{ ... } @isTest private ...


4

The String class had isNumeric(), isAlpha() and a number of other methods for checking the contents of Strings added in Winter '13. The documentation for these methods can be found here : isNumeric isAlpha String Instance methods isNumeric() Returns true if the current String contains only Unicode digits; otherwise, returns false. isAlpha() Returns true if ...


4

When first starting to deal with incoming spam via web to lead or case, I always start with these suggestions - https://help.salesforce.com/apex/HTViewSolution?urlname=How-to-resolve-Web-to-X-Spam-issues-1327109135974&language=en_US. Once those are exhausted though, I've used a variety of more complex fixes, usually not on the salesforce side.


4

Here is a detailed tutorial that explains how to create a custom publisher action for Case Comments. Once you complete all the steps, the Case Comment shows up as a publisher action as shown below.


4

Thread Ids are generated only for outbound emails from within the case. Since you have enabled thread ids, you should start seeing them on the Email related list once you send out emails regarding the case. The thread ID will be in the form: ref:XXXXXX.XXXXXXXXX:ref Read more about it here


4

To fix this issue at the root would be to have your mail server configured in such a way that emails which contain key words, such as 'Out of office', are ignored. Although that would typically be an IT Helpdesk remit and not for a Salesforce Admin / Developer. From a Salesforce Developer perspective, you can write a trigger which auto-deletes or prevents ...


4

I think your issue might be with how you're handling the inbound email from Outlook/Exchange. If you're "Forwarding" the email to the unique SFDC email address, then it is in fact coming from your support email address. Try "Redirecting" the email instead. This should preserve the users From address.


4

This is how I solved the problem, after saving off the attachments then I updated the message body to replace the cid references with URL to the files. For some magical reason, Salesforce will properly format the reply in a way that the inline images appear. This solution is inspired by Bhawani Sharma. There are two files: 1. EmailUtils 2. ...


4

In general terms, the 'Source' refers to the channel from where Case was created. Technically the error is saying there is no Object Type for 'ToAddress'. However, 'ToAddress' is a standard field on 'EmailMessage' object. In order to use it, you will need to append your formula like this below. Source:EmailMessage.ToAddress This specifies that the source ...


3

Hits me every time ;) Recently (Spring'13) SF decided to be helpful in the emails area. Every time you refresh a sandbox they set the Email Deliverability to only system emails. You need to flip it in the Setup -> Deliverability (Access level = all email). Without this the "send an email" button is gone on the Activity History rel. list and all other ...


3

If you need/want a configuration only solution (no apex), you can do you this. Define a specific case origin for each of you E2C addresses, and set then on the emails as appropriate. For example "Email-Support" or "Email-Info". To prevent your users from accidently selecting these sources, create a validation rule that only allows your default case ...


3

I haven't tried this but I guess you can create a before trigger on the EmailMessage object and remove the values on the ccAddress field by default. For the other question, you could have a field on the case that would store the list of addresses and based on that field being populated you would automatically pass that value on the URL when clicking on the ...


Only top voted, non community-wiki answers of a minimum length are eligible