• St57 M
  • 0 Points
  • Member since 2014

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
  • 0
Hi All need a small help in
how to send email along with attachment  using Amazon SES from apex class?

I am able to send email using 'Action=SendEmail' (like http://salesforce.stackexchange.com/questions/18428/connection-between-awsamazon-web-service-ses-and-sales-force-using-apex-code-t)but unable to send email along with attachment.
  • September 22, 2014
  • Like
  • 0

I need small information regarding Amazon SES to send emails from Salesforce.

I have 1200 records,I want to send emails to all record owners by using Schedule Class or Workflows we are faceing some limitation(Cann't send more than 1000 email per day).

So,I need to send emails through Amazon.

Can any one help me regarding this problem....I need smaple code for this.

  • September 09, 2014
  • Like
  • 0

How to send email to the particular Account after 5 days based on Opportunity phone number is notequal to null.

Ex: Suppose i have created  Account date is 1/2/2013 and opoortunity phone number is notequal to null ,finally  email to be  send to Account owner like this date 5/2/2013.

it's not working using workflow,it is possible using shecdule apex so if any one know the schedule apex could you please help me.
  • April 21, 2014
  • Like
  • 0
Is there any possiblity to create custom button in user?
  • February 14, 2014
  • Like
  • 0
How to Generate PDF(without using renderAs in VisualForce Page) after clicking on custom button in Visualforce force page using custom controller.could u please help me any one
  • February 11, 2014
  • Like
  • 0
When i am adding a report to particular Dashboard,i am getting ab Error like...

"This Report Can't be used as the source for this component.if it is summery or matricx report,add one or more grouping in the report.if it is tabular report with a row limit,specify the Dash Board setting in the report"....

how to rectify this error....?it's a new developer account
  • February 03, 2014
  • Like
  • 0
My test class is not working:


public with sharing class OpportunityPDF {

    public Opportunity opp{get;set;}
    public list<OpportunityLineItem> product{get;set;}
    public list<OpportunityLineItem> product1{get;set;}
    public Double total{get;set;}
    public Decimal discount{get;set;}
    public Decimal grandTotal{get;set;}
    public Date Today { get { return Date.today(); }}
    public Date lastDate{get;set;}
    public List<terms_and_conditions__c> termsList{get;set;}
    public List<terms_and_conditions__c> termsList12{get;set;}
    public List<WrapperClassEx> wrapperObj{get;set;}
    public Boolean checkBox{get;set;}
    public Boolean displayPopup {get;set;}
    public set<string> TCNames {get;set;}
    public list<Terms_and_Conditions__c> TRC{get;set;}
    public OpportunityPDF(){
            opp = [select id,CreatedBy.Email,Opportunity_Number__c,CreatedBy.Fax,CreatedBy.Phone,Account.Name, Account.BillingCity , Account.BillingCountry , Account.BillingState ,Account.BillingStreet,Account.BillingPostalCode ,Account.Insurance_Company__c ,
                      Contract_Start_Date__c,Contract_Term_Months__c,CloseDate,Payment_Terms__c,TotalOpportunityQuantity,Name,Shipping_Method__c,Shipping_Terms__c    from Opportunity where id = :Apexpages.currentpage().getParameters().get('id')];
            product = [select id,Opportunity.Id ,Total__c,Discount,Billing_Frequency__c,Billing_Type__c,UnitPrice,Quantity ,Description,TotalPrice,PricebookEntry.Product2.Name  from OpportunityLineItem where Opportunity.Id  = :opp.id and Billing_Type__c = 'Initial'];
            product1 = [select id,Opportunity.Id ,Billing_Frequency__c,Total__c,Billing_Type__c,UnitPrice,Quantity ,Description,TotalPrice,PricebookEntry.Product2.Name  from OpportunityLineItem where Opportunity.Id  = :opp.id and Billing_Type__c = 'Subscription'];
            total = 0.00;
            discount = 0.00; 
            grandTotal = 0.00;
            for(integer i = 0;i<product.size();i++){
                /*Calculate sum of total*/
                total+= product[i].Total__c;
                    discount+= product[i].Total__c-product[i].TotalPrice;   
                    grandTotal= total-discount;
            Date todayDate = System.today();
            Date firstDate = todayDate.toStartOfMonth();
            lastDate = firstDate.addDays(date.daysInMonth(todayDate.year(), todayDate.month()) -1 );
            checkBox = false;
            wrapperObj = new List<WrapperClassEx>();
            TRC = new  list<Terms_and_Conditions__c>();
            String decodedUrl = EncodingUtil.urlDecode(Apexpages.currentpage().getParameters().get('TCList'), 'UTF-8');
            set<string> TCNames = new set<string>();
            List<String> TcNamesArray = decodedUrl.split(',,',0);
            for(integer i=0;i<TcNamesArray.size();i++){
            termsList = [Select id,name,subject__c,Description__c from Terms_and_Conditions__c where name in :TCNames ];
            for(Terms_and_Conditions__c ter: termsList){
                String termDesc = ter.Description__c;
                termDesc = termDesc.replace('Contract Term',+String.valueOf(opp.Contract_Term_Months__c));
                Datetime myDatetime = (opp.Contract_Start_Date__c).addDays(1);
                String myDatetimeStr = myDatetime.format('MMMM d,  yyyy');
                termDesc = termDesc.replace('Start Date',myDatetimeStr);
                termDesc = termDesc.replace('payment term',+String.valueOf(opp.Payment_Terms__c));
                ter.Description__c = termDesc;
                wrapperObj.add(New WrapperClassEx(ter,checkBox ));
   public Class WrapperClassEx{
   public Terms_and_Conditions__c termObj{get;set;}
   public Boolean checkBox{get;set;}
   public WrapperClassEx(Terms_and_Conditions__c termRec,boolean checkBox ){
        this.termObj = termRec;
        this.checkBox = checkBox ;
               this.checkBox = true;

Test Class:code coverage is 54%....

public class OpportunityPDF_TC
    static testmethod void method1()
        CloneOpportunityTrigger__c clone = new CloneOpportunityTrigger__c();
        clone.Trigger_Status__c = true;
        clone.setupownerid = UserInfo.getUserId();
        insert clone;
        Terms_and_Conditions__c term = new Terms_and_Conditions__c();
        Boolean bool=true;
        term.Name = 'GPS';
        term.Subject__c = 'GPS';
        term.Description__c = 'des';
        insert term;
        Opportunity opp1 = new Opportunity(name='Test Opp 1',StageName = 'Closed Won',CloseDate = Date.newInstance(2009,01,01), Pricebook2Id='01s800000003VCr',
                                                 Renewable__c = true,Contract_Start_Date__c = Date.newInstance(2015,01,01),Contract_Term_Months__c = 1.0);
        insert opp1;

        system.assertEquals(opp1.name,'Test Opp 1');
        String encoded = EncodingUtil.urlEncode('test', 'UTF-8');
        String TRC = Apexpages.currentpage().getParameters().put('test',opp1.name);
        String decodedUrl = EncodingUtil.urlDecode('TRC','UTF-8');
        OpportunityPDF pdf = new  OpportunityPDF();
        pdf.checkBox = true;

i am getting an error like:

Error Message System.NullPointerException: Argument cannot be null.
Stack Trace (System Code)
Class.OpportunityPDF.<init>: line 50, column 1
Class.OpportunityPDF_TC.method1: line 37, column 1

Could you please help me any one,it is very urgent requiremnt 
  • January 31, 2014
  • Like
  • 0
I am created a New Lead record,after saving a record clicking on convert button it is redirected to account page ,is there any possibility  to redirect to opportunity page:
How to redirected to Opportunity page after Lead Conversion......Could you please help me any one known......
  • January 24, 2014
  • Like
  • 0

I have crated a one field i.e Birthdate. then value is like 12/01/2014.i have to update a records through date loader at that time i would like to change a birthadate value is 13/02/2015,after impoting a records the birthdate is updated but we got value as 12/02/2015,day value is not change.why?
if any budy known could you please help me....
  • January 22, 2014
  • Like
  • 0