4

If you're specifically sending the emails to salesforce, you can use custom headers (headers that start with "X-"), and they will be available in the InboundEmail's header array. RFC 822 states that all headers starting with X- are considered safe for custom use, so they should appear correctly in the inbound email. You'll need to write or configure an ...


4

You need to wrap your checks against rating_region__c in a null check. if (String.isNotBlank(dep.rating_region__c)) { if(dep.rating_region__c.contains('Region 1')){dep.rating_region_number__c=1.000;} if(dep.rating_region__c.contains('Region 2'))//checks rating regions {dep.rating_region_number__c=1.009;} if(dep.rating_region__c....


3

I think you can set the status value with the sequence number. 0 - New 1 - Read 2 - Replied 3 - Sent 4 - Forwarded 5 - Draft So it could be like this EmailMessage emailMessage = new EmailMessage(); emailMessage.status = '3'; // email was sent


3

006 is id key prefix for Opportunity. We know that SF id is 15 digit Case-Sensitive and 18 Digit Case Insensitive. All Opportunity ID will start with 006 and last 12 or 16 digits will be alphanumeric based on type. Your regex is trying to find if the ID mentioned is proper or not. 006- Opportunity 001- Account 003- Contact 005-Case 500- User. So ...


3

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


3

I have written a custom logic to solve this problem for you(@ray) by spliting the response into parts using regular expression \\w{2} \\w{3}, \\w{3} \\d{2}, \\d{4} at \\d{1,2}:\\d{2} [PA]M, .*:, please check and try to execute this in your sandbox to test it: String parseResponse(String message){ List<String> splitResult = message.split('\\w{2} \\...


3

Your problem is here: o = [select id, accountid, name from Opportunity where id = :ApexPages.currentpage().getParameters().get('id')]; This code throws exception (the one you're seeing) if no results are returned by the query. The reason you have no results is that the code is using a hardcoded ID: public static testMethod void testAdd() { ...


2

For Production endpoint is https://login.salesforce.com and for sandbox endpoint is https://test.salesforce.com/. If you are using OAuth for authentication then you have to send a request for authorization at https://login.salesforce.com/services/oauth2/authorize and then after authorization you need to send token request at https://login.salesforce.com/...


2

This is resolved. Apparently, it looks like there is a setting to restrict the email address / domain in one another place from other than the 'Accept email from' setting while defining the email service and this setting is located in the 'Email Service Address' page. This setting had my email address populated (which meant 'accept emails only from my ...


2

you have to define a new email service like below : - create a Apex class named like "CreateRecordFrmEmail" Your Name | Setup | Develop | Email Services . refer the class which will be given below . and use this class based on you logic. /** * Email services are automated processes that use Apex classes * to process the contents, headers, and ...


2

Attachment.Body is of type base64 so, as long as the source string is valid UTF-8, you can set this field using: myAttach.Body = Blob.valueOf(theXmlString); myAttach.Name = 'myfilename.xml';


1

you didnot close the newParentOpp addition. newParentopp.add(new Parent_Opportunity__C(Description__C = myPlainText, Priority__C = '1', Subject__C = email.subject); and then try 😊


1

Yes, You cannot make more than 25 Long running API calls. It will stop all transactions after 26th till the running 25 calls leave resources for next calls. Its Governor limit. Can an inbound rest service perform a callout? Yes it can, just a caveat, if the calling system is SF, Your System is SF and then you call to other system which is also SF then its ...


1

@Abhijeet, if I'm understanding correctly what you want to do is insert the child records only for the parent records that were successfully inserted, and ignore any child records that are related to parent records that were not inserted successfully. First of all, if you are going to send both parent and child records in just one API call: You will need ...


1

This is because you can't directly use them in class. This is not the correct format. You need methods to assign them value. public static testmethod testOne() { Messaging.InboundEmail email = new Messaging.InboundEmail(); Messaging.InboundEnvelope env = new Messaging.InboundEnvelope(); email.subject = 'FW: Incident 20216330'; env.fromAddress = '...


1

In general, you should probably already know. However, for sake of argument, if you didn't know, you could always run the API Usage Last 7 Days report (note: if this link doesn't work, go to Reports > Administrative Reports > API Usage Last 7 Days). You'll get a list of login types that are being used, as noted in the Client Id column. Most developers are ...


1

So, the answer is basically YES, but indirectly InboundEmailHandler parses the subject or body, looking for some keyword If keyword is found, update some field on an Sobject that.. Makes a workflow/process builder triggering criteria true and hence workflow executes Workflows and Process Flows require a DML operation to be launched However, Apex can call ...


1

Try this it will solve your problem global class contact_Task_Create_FromEmailService implements Messaging.InboundEmailHandler { global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email, Messaging.InboundEnvelope envelope) { Messaging.InboundEmailResult result = new Messaging.InboundEmailresult(); String emailFrom = ...


1

On email service, select Accept Email From All email addresses (subject to security settings)


1

Here's one way I see to do it: First, split your email body by lines using: String[] bodySplitted = email.PlainTextBody.split('\n'); After that you will have an array filled with each line of your email body Then, if we assume that you will always have the values in the same order and this separator between your labels and your values: ': ' like Firstname: ...


1

To @kazoolsky's comment, if your ORG is small enough that creating new fields in Prod will not impact the business than I would advise doing that. Do you have a development team/person? If not you can hire SF developers on a contract basis to do small jobs like this. Test code often needs to be updated as the ORG grows/changes. Hope that helps, good luck! *...


1

You should be able to "trick" Salesforce into letting you do this with your Inbound Email Service's failure response settings. Ensure the Accept Email From setting of your Inbound Email Service does not contain any addresses with the salesforce.com domain in them Set the Unauthorized Sender Action to "Bounce Message" Check the Enable Error Routing box and ...


1

You can write the assignment logic inside a class that goes along with your inboundemail service.


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