• phantom82
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

Hi guys,

 

Need your help being a newbie in salesforce development. I would be grateful to anyone who could write a Unit Test for the following piece of code.

 

 

public class SalesLetViewEmail
{
    public void sendemail()
    {        
        String mailAddresses, mailaddresses1 =  'XXX@abc.com';
        String mailadd = '<html><body><table><tr></tr><tr><b><td>Event Owner</td><td>||</td><td>Link</td></b></tr>';
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        integer i= 0;
 
        User Usales,Ulettings;
        RecordType R = [SELECT Id FROM RecordType WHERE SobjectType = 'Event' AND Name = 'Sales Viewing'  LIMIT 1];
        //RecordType R1 = [SELECT Id FROM RecordType WHERE SobjectType = 'Event' AND Name = 'Lettings Viewing'  LIMIT 1];
        
        for(Event evt: [select CreatedbyId from Event where RecordTypeId =: R.Id
        and Offer_Y_N__c = NULL
        and StartDateTime < Today])
        {
           if (evt.CreatedbyId != NULL)
           {
           Usales = [select Name, Email from User where Id =: evt.CreatedById];
           mailAddresses += ';'+Usales.Email;
           mailadd += '<tr><td>'+USales.Name+'</td><td>||</td><td>https://nsX.salesforce.com/'+evt.Id+'</td></tr>';           
           i++;
           }
        }
        mailadd += '</table></body></html>';
         
         
         String[] toAddresses = new String[] {'XXX@abc.com'};
         //String[] toAddresses = mailAddresses.split(';');
         mail.setToAddresses(toAddresses);
         mail.setSubject('Enter Viewing Feedback!');
         mail.setHtmlBody('Please enter your Sales Viewing feedback and confirm whether an offer was made.'+mailadd);      
         Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
         
         
 
    }
}

 

Thanks!!!!!!

 

 

 

Hi All,

 

I want to recreate a martix report in a visualforce page, so that the users can do inline editing and save the records. There are 2 objects involved here (Opportunities(Parent) and Revenue Schedule(Custom - Child). I want the Opportunity Names on the left hand side of the report/vf page and then the Revenue Schedule child records to display horizontally next to each Opportunity record. The header of the revenue shedule records must display only Date (e.g. August 2010, September 2010...), and if a child record has a date that falls withing the header date then display a value for the user to update.

 

I have been reading in the community to find a solution and i think that i might get this right using <apex repeat> , but i am not sure. Any suggestions?

 

Thanks Community

 

Rudi