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

FATAL_ERROR|Internal Error

I am using lightning component. There is a component to send email with fields to, subject, body and send button, cancel button.
on send button it calls to apex method as below: 
    public static void sendMailMethod( String mMail ,String mSubject ,String mbody, String recId ){
        //Fetching user details for cc the user in mail
        User u = [SELECT Id, Name, Email, Phone, MobilePhone FROM User where id =: userInfo.getUserId()];
        //Attach pdf timesheet to the mail
        PageReference pdfPage = new PageReference('/apex/time_WeeklyPDF?id='+recId); 
        //Get VisualForce page data  
        Blob file1;
        if(Test.isRunningTest()) { 
            file1 = blob.valueOf('Unit.Test');
        } else {
            file1 = pdfPage.getContentAsPDF(); 
        // convert VisualForce page to  PDF format
        Messaging.EmailFileAttachment efa = new Messaging.EmailFileAttachment();             
        // Create Attachment
        List<Messaging.SingleEmailMessage> mails =  new List<Messaging.SingleEmailMessage>();     
        // Step 1: Create a new Email
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        // Step 2: Set list of people who should get the email
        string[] toaddress = mMail.split(',');
        string[] ccAddresses = new String[]{u.Email};
        // Step 3: Set who the email is sent from
        mail.setReplyTo(''); // change it with your mail address.
        mail.setSenderDisplayName('salesforce User'); 
        // Step 4. Set email contents - you can use variables!
        mail.setFileAttachments(new Messaging.EmailFileAttachment[] {efa});
        // Step 5. Add your email to the master list
        // Step 6: Send all emails in the master list
It was working previously but today when i clicked on send button its giving error as "FATAL_ERROR|Internal Error" in debug log and nothing happens.
Need help on workaround for this, Why this error comes??
shailendra singhaishailendra singhai
Hi I was getting the same issue; It is fixed now
   PageReference pdf = Page.PDFGenarator;
             pdf.getParameters().put('Id', conlist[0].accountid);  ///add shailendra  
I was missing upon last line
  pdf.getParameters().put('Id', conlist[0].ID);

may some where the incorrect ID is getting pass;