• Silpi Roy 19
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 2
    Questions
  • 2
    Replies
I want to send a single  email with multiple attachment using scheduler class.But email is not trigerring for the same.
global class SendEmailReports implements System.Schedulable  {
    global void execute(SchedulableContext sc) {
        SendEmail();

    }

    //Public String subject { get; set; }
   // public String body { get; set; }
    //private final Report rep;
    
         
     @future(callout=true)
   
    public static void sendEmail() {


 
      list<Report>  rep = [SELECT id, name FROM Report WHERE ownerId IN (
    SELECT ID FROM Folder WHERE Id='00l0C000000MJKvQAO')];
    }



    public PageReference send() {
        // Define the email 
        Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage(); 
        // Reference the attachment page and pass in the Report ID 
        Integer numAtts=[SELECT count() FROM attachment WHERE parentId=:ApexPages.currentPage().getParameters().get('Id')];
        system.debug('Number of Attachments Atts = '+ numAtts);
        List<Attachment> allAttachment = new List<Attachment>();
        allAttachment = [SELECT Id, Name, ContentType, Body FROM Attachment WHERE parentid =:ApexPages.currentPage().getParameters().get('Id')];
        List<Messaging.Emailfileattachment> efaList = new List<Messaging.Emailfileattachment>();
     
        // try{ 
        if(numAtts > 0){
                for (Integer i = 0; i < numAtts; i++){
                    system.debug(allAttachment[i].Name);
            Messaging.Emailfileattachment efa = new Messaging.Emailfileattachment();            
            efa.setFileName(allAttachment[i].Name);
                    efa.setBody(allAttachment[i].Body);
                    efa.setContentType('text/csv');
            efaList.add( efa );
                }
        }
         
        
      String[] toAddresses = new String[] {'silpi.roy@atos.net'};

       email.setToAddresses(toAddresses);


        // Sets the paramaters of the email 
        
       // email.setFileAttachments(email_attachments);
        email.setPlainTextBody('The report is attached.');
        //Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});
    
        
        
        

       
        //email.setFileAttachments(new Messaging.EmailFileAttachment[] {List<email>()});
        if(numAtts > 0){
           email.setFileAttachments(efaList );
        }
         
        // Sends the email 
        Messaging.SendEmailResult [] r = 
            Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});   
        return null;
    }
}

Please help
I am new to salesforce need help to write apex class for the following criteria:

Inputs

 
ParameterOptionalComments
TypeNName of the ruleset
CreateContactNCreate Contact 1 (Yes) 0 (No) if match not found
ContactFirstNameNFirst name
ContactLastNameNLast Name
ContactHomePhoneNPhone Number
ContactTitleNTitle
ContactGenderNGender
ContactDOBNDate of Birth
ContactPostcodeNPost Code
ContactEmailAddressNEmail Address
ContactBTNumberYBT Number
ContactCoachCodeYCoach Code
ContactATPIdYATP Id
ContactWTAIdYWTA Id
ContactIpinIdYiPin Id
ContactTEIdYTE Id
ContactOfficialNumberYOfficial Number
 

Outputs

ParameterOptionalComments
ContactRowIdNSiebel Id of winning match if match found
StatusNNoMatch – no matches found
Match – one match found
Duplicate – duplicate matches found
Error - error
UsernameNUsername of winning match
IsMemberNIs the winning match a BT member?
IsClubAffiliatedNIs the winning match affiliated to a venue?
ContactListYSearch Expression of matching contacts in the format [Contact Id] = ‘X’ OR [Contact Id] = ‘Y’
 

Algorithm


There are three entry points for contact match:
 
  1. ContactMatch (match for given criteria and contact data)
  2. ContactMatchBatch (as above for for multiple contact records)
  3. ContactMatchIO (as contact match except input paramters are in an IO instead)


ContactMatch
Read Input Parameters
Read External Parameters from category “ContactMatch” + Type (input parameter)

For each criteria row where there is non null contact data
Status = ContactSearch
Exit if match found
End Loop

If CreateContact = 1 and ContactId = “” and Status <> “Error” then
            ContactCreate
End If

If Type = “InternationalPlayers” and ContactId <> “” and (Status = “Match” or “Duplicate”) then
            Status = ContactUpdate
End If

PostMatchActions

Return ContactId, Status, IsMember, IsClubAffiliated, LoginName, ContactList

ContactMatchBatch
Invoked by Contact List Applet (Admin) via BC LTA Contact Administration where Type = “UI”
Or by workflow process “LTA Contact Match” where Type = “Batch”

            Read Input Parameters

Query for contact search expression
Loop
            Retrieve data fields from contact record
            ContactMatch
End Loop

ContactMatchIO
Invoked by workflow “LTA PDS Publish Catalog Web Service” or “LTA Zendesk Query Contact Web Service”

Retrieve data fields for contact

ContactMatch
Thanks in advance
I want to send a single  email with multiple attachment using scheduler class.But email is not trigerring for the same.
global class SendEmailReports implements System.Schedulable  {
    global void execute(SchedulableContext sc) {
        SendEmail();

    }

    //Public String subject { get; set; }
   // public String body { get; set; }
    //private final Report rep;
    
         
     @future(callout=true)
   
    public static void sendEmail() {


 
      list<Report>  rep = [SELECT id, name FROM Report WHERE ownerId IN (
    SELECT ID FROM Folder WHERE Id='00l0C000000MJKvQAO')];
    }



    public PageReference send() {
        // Define the email 
        Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage(); 
        // Reference the attachment page and pass in the Report ID 
        Integer numAtts=[SELECT count() FROM attachment WHERE parentId=:ApexPages.currentPage().getParameters().get('Id')];
        system.debug('Number of Attachments Atts = '+ numAtts);
        List<Attachment> allAttachment = new List<Attachment>();
        allAttachment = [SELECT Id, Name, ContentType, Body FROM Attachment WHERE parentid =:ApexPages.currentPage().getParameters().get('Id')];
        List<Messaging.Emailfileattachment> efaList = new List<Messaging.Emailfileattachment>();
     
        // try{ 
        if(numAtts > 0){
                for (Integer i = 0; i < numAtts; i++){
                    system.debug(allAttachment[i].Name);
            Messaging.Emailfileattachment efa = new Messaging.Emailfileattachment();            
            efa.setFileName(allAttachment[i].Name);
                    efa.setBody(allAttachment[i].Body);
                    efa.setContentType('text/csv');
            efaList.add( efa );
                }
        }
         
        
      String[] toAddresses = new String[] {'silpi.roy@atos.net'};

       email.setToAddresses(toAddresses);


        // Sets the paramaters of the email 
        
       // email.setFileAttachments(email_attachments);
        email.setPlainTextBody('The report is attached.');
        //Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});
    
        
        
        

       
        //email.setFileAttachments(new Messaging.EmailFileAttachment[] {List<email>()});
        if(numAtts > 0){
           email.setFileAttachments(efaList );
        }
         
        // Sends the email 
        Messaging.SendEmailResult [] r = 
            Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});   
        return null;
    }
}

Please help
Hi there,

I am getting this kind of warning when saving Lightning Flow (Spring'19 ver).
Is there any way to clear it?

This screen includes screen components that require Lightning runtime.

User-added image

Regards,
LinThaw
Hi there,

I am getting this kind of warning when saving Lightning Flow (Spring'19 ver).
Is there any way to clear it?

This screen includes screen components that require Lightning runtime.

User-added image

Regards,
LinThaw