• Andrea Barquin
  • 10 Points
  • Member since 2017
  • Kaseya

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
  • 1

We recenlty refreshed our sanbox and we started getting  "System.CalloutException: Unexpected end of file from server" error when making an API call to the external service from our sandbox environment. It used to work fine before and the same call is still working in our production environment. 

There are no blocking rules in the Firewall. Is there a way to diagnose? Is possible to get something similar to a traceroute from the sanbox to our server where the API resides?
I have an apex extension for a visualforce page that sends emails using the SignleEmailMessaging method. It sends email using an email template with merge fields from a custom object called ParticipantEmail. However, I am getting an error on the WhatId method call.

here is that part of the code:
       //the class WrapTemp has two attributes, one of type ParticipantEmail__c named tempRec and the second one is a string named type_member
        for (WrapTemp wCM : pEmails){
            Messaging.SingleEmailMessage mess = new Messaging.SingleEmailMessage();
            List<String> bccAddys = new List<String>();
            system.debug('wCM.tempRec.ContactId = ' + wCM.tempRec.ContactId__c);
            system.debug('wCM.tempRec.Id = '+wCM.tempRec.Id);
            //set the contact to be emailed
            system.debug('wCM.tempRec.Id = '+wCM.tempRec.Id);
            id theRecId = wCM.tempRec.Id;
            system.debug('theRecId = '+ theRecId);            
            if (wCM.type_member == 'Participant') 

Here is what I get from the debugger:
User-added image
It says the id is a284B0000007BOiQAM

but then the error I get says this 

System.EmailException: SendEmail failed. First exception on row 0; first error: INVALID_ID_FIELD, Invalid entity type for whatId.: [whatId, a284B0000007BPf]
Error is in expression '{!SendTheEmails}' in component <apex:commandButton> in page cmsendemailsvf: Class.CMSendEmails.SendTheEmails: line 129, column 1

Does anyone see what my problem is here?  I have no idea.