• tiran
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 3
    Replies

Hello ,

I have some qestions in salesforce,could u help me to solve these?

1.I want to add a button in my task page,the function of this button is to save and update the statut in my task page.

2.It is possible to modify the task reminder popup widows of salsforce, in that popup windows,i can add some buttons?

3.It is possible to use batch in a spooling that can send emails and print the emails or the pdfs at the same time?

Thank u in advance

Best wishes

 

  • June 20, 2012
  • Like
  • 0

Hello everyone.

 

I came acrosee a problem,that is:

 

I created a page,renderAs="pdf",then in components,i got all datas to the body part. So,the result is when i click un button in the opportunity,i can get a pdf.

 

But my chef ask me to add the javascript that can call a  mouse events when passing a url in the PDF.

 

I want to know that it is possible to implement this funtion or not? and how?

 

Thank u !

  • June 19, 2012
  • Like
  • 0

Hello.I have a question about the pdf in Email.I want to attache two pdf,one is generated by salesforce,one is static pdf.It is possible?

 

Now,i can only receive one pdf.Anyone can give a help,thank u !!

 

Code:

 

 PageReference Quittance = Page.QuittanceA;
            Quittance.getParameters().put('id',Opp.id);

            Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
 
                      mail.setBccSender(true);
                      mail.setSenderDisplayName('xxxxx');
                      mail.setCcAddresses(Emails);
                      mail.setSubject(xxx);    
                      mail.setPlainTextBody(
                     xxxxxxxx                  
                       );
                     
            Blob htmBlob = Quittancee.getContent();
            Attachment a = new Attachment(parentId = Opp.id, name=Orec.name + '.pdf' +'    '+'(xxxxxx)', body = htmBlob, isPrivate=false);
            insert a;


      //static pdf          
    List<StaticResource> objPDF = [Select body, name from StaticResource where Name = 'pdf'];
    Messaging.EmailFileAttachment[] objEmailAttachments = new Messaging.EmailFileAttachment[1];
    Messaging.EmailFileAttachment objPDFAttachment = new Messaging.EmailFileAttachment();
    objPDFAttachment.setBody(objPDF[0].Body);
    objPDFAttachment.setFileName(objPDF[0].name + '.pdf');
    objEmailAttachments[0] = objPDFAttachment;
      mail.setFileAttachments(objEmailAttachments);


                  mail.setFileAttachments(new Messaging.EmailFileAttachment[] {myEQuote});
                      mail.setWhatId(Opp.id);
                      mail.setTargetObjectId(OppContact.Id);
                      myEQuote.setFileName(Orec.name.replace('/',' - ')+'.pdf');
                      myEQuote.setBody(htmBlob);
                   
                      Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
                

 

  • June 14, 2012
  • Like
  • 0

  Hello,everyone.I am new for the salesforce. Now i have a problem about sending email.

 

  I want to send outbound Emails to the clients if the status is update.However,i also create a personal HTML Email template.

 

  Now,the problem is,if i just send a text email that i write in the apex class,it runs well,i can receive the email.but if i use the email template,it always has a error .Please help me ,thank you very much!

 

 

 The code trigger:


trigger SendEmail on Opportunity (after update) {
String OldStatutPolice;
String NewStatutPolice;
Opportunity o=Trigger.New[0];
OldStatutPolice=trigger.old[0].Statut_Police__c;
NewStatutPolice=trigger.new[0].Statut_Police__c;


if((OldStatutPolice=='Proposition') && (NewStatutPolice=='Nouvelle Police (active)') )
{
NewPoliceSendEmail.SendEmail(o);
}
}

 

The code Apex Class:

 

public with sharing class NewPoliceSendEmail {


public static void SendEmail(Opportunity o)
{
      
 
if(o.Statut_Police__c=='Nouvelle Police (active)'){
    
    
    Opportunity OppAcc = [select Accountid from Opportunity where id = :o.id];
          
     Contact contact = [select Email from Contact where Accountid = :OppAcc.AccountId and Destinataire__c='Oui'];
    EmailTemplate et = [SELECT Id FROM EmailTemplate WHERE DeveloperName='Mail_Remerciement'];
 Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
 
                        mail.setTargetObjectId(contact.id);

                       mail.setBccSender(false);
                       mail.setSenderDisplayName('xxxxxx@xxxxxxl.com');
                       mail.setSubject('Merci');    
                       mail.setTemplateId(et.Id);
                       Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
}
}
}

 

  The error is INVALID_FIELD_WHEN_USING_TEMPLATE, When a template is specified the plain text body, html body, subject and charset may not be specified : []:

  • June 13, 2012
  • Like
  • 0

Hello everyone.

 

I came acrosee a problem,that is:

 

I created a page,renderAs="pdf",then in components,i got all datas to the body part. So,the result is when i click un button in the opportunity,i can get a pdf.

 

But my chef ask me to add the javascript that can call a  mouse events when passing a url in the PDF.

 

I want to know that it is possible to implement this funtion or not? and how?

 

Thank u !

  • June 19, 2012
  • Like
  • 0

  Hello,everyone.I am new for the salesforce. Now i have a problem about sending email.

 

  I want to send outbound Emails to the clients if the status is update.However,i also create a personal HTML Email template.

 

  Now,the problem is,if i just send a text email that i write in the apex class,it runs well,i can receive the email.but if i use the email template,it always has a error .Please help me ,thank you very much!

 

 

 The code trigger:


trigger SendEmail on Opportunity (after update) {
String OldStatutPolice;
String NewStatutPolice;
Opportunity o=Trigger.New[0];
OldStatutPolice=trigger.old[0].Statut_Police__c;
NewStatutPolice=trigger.new[0].Statut_Police__c;


if((OldStatutPolice=='Proposition') && (NewStatutPolice=='Nouvelle Police (active)') )
{
NewPoliceSendEmail.SendEmail(o);
}
}

 

The code Apex Class:

 

public with sharing class NewPoliceSendEmail {


public static void SendEmail(Opportunity o)
{
      
 
if(o.Statut_Police__c=='Nouvelle Police (active)'){
    
    
    Opportunity OppAcc = [select Accountid from Opportunity where id = :o.id];
          
     Contact contact = [select Email from Contact where Accountid = :OppAcc.AccountId and Destinataire__c='Oui'];
    EmailTemplate et = [SELECT Id FROM EmailTemplate WHERE DeveloperName='Mail_Remerciement'];
 Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
 
                        mail.setTargetObjectId(contact.id);

                       mail.setBccSender(false);
                       mail.setSenderDisplayName('xxxxxx@xxxxxxl.com');
                       mail.setSubject('Merci');    
                       mail.setTemplateId(et.Id);
                       Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
}
}
}

 

  The error is INVALID_FIELD_WHEN_USING_TEMPLATE, When a template is specified the plain text body, html body, subject and charset may not be specified : []:

  • June 13, 2012
  • Like
  • 0