• kavya mareedu
  • NEWBIE
  • 40 Points
  • Member since 2018
  • Salesforce Developer

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 24
    Replies
Here is my program:

public class Outbound_Example_3 {
    public void invoke(){
        Messaging.SingleEmailMessage msg =new Messaging.SingleEmailMessage();
        Contact con=[select id ,AccountId from Contact where createdDate=TODAY];
        msg.setTargetObjectId(con.Id);
        msg.setWhatId(con.AccountId);
        EmailTemplate et =[select id from EmailTemplate where name='Case Response'];
        msg.setTemplateId(et.id);
        
        Document doc =[select id,Name,Body,ContentType ,Type from Document where name='Email Messaging'];
        Messaging.EmailFileAttachment eft1 =new Messaging.EmailFileAttachment();
        eft1.setFileName(doc.Name+doc.type);
        eft1.setBody(doc.body);
        eft1.setContentType(doc.ContentType);
        
        PageReference p=Page.EmailSerc;
        Blob body=p.getContentAsPDF();
        Messaging.EmailFileAttachment eft2 =new Messaging.EmailFileAttachment();
        eft2.setFileName('EmailSerc');
        eft2.setBody(body);
        List<Messaging.EmailFileAttachment> files =new List<Messaging.EmailFileAttachment>{eft1,eft2};
        msg.setFileAttachments(files);
        Messaging.Email[] emails =new Messaging.Email[]{msg};
        Messaging.sendEmail(emails);    
        
    }
}


Outbound_Example_3 ou=new Outbound_Example_3();
ou.invoke();


Please let me know where am I going wrong.
Thanks!
Hello,

I am a 'Ranger' now and I want to know when will I get my hoodie !!!

 
My question is: When ever lead is inserted, with leadsource as web set wilson as owner of record. If the leadsource is other than web then assign it to lifeQueue as owner.

Ans:

public class Lead_Example {
    
    User u= [Select id from User where FirstName LIKE 'wilson'];
    group g= [Select id from Group where type='Queue' and name='LifeQueue'];
    public static void callMe(List<Lead> leads) 
    {
        for(Lead l: leads)
        {
            if(l.LeadSource=='web')
            {
                l.OwnerId= u.id;
            }else{
                l.OwnerId=g.id;
            }
        }
    }
}

Trigger Callout:
trigger Lead_Example on Lead (before insert) {
    List<Lead> leads=Trigger.new;
    
    Lead_Example.callMe(Trigger.new);
    
}

}Please Help!!!!!


In the above example, I need to write a trigger in such a way that whenever I create a new contact an email should be sent to me with the details also the count of number of triggers.

I have written this class for the above example:

public class EmailManager {
    public static void sendMail(List<contact> contacts)
    {
        for(Contact c: contacts)
        {
            if(c.email!=null)
            {
                c.email='kavya@system.in';
            }
        }
  
    }
    

}

This is the trigger:

trigger ExampleTrigger on Contact (after insert,after delete) {
    list<contact> contact= Trigger.new;
    if(Trigger.isInsert){
        Integer recordcount= Trigger.new.size();
        EmailManager.sendMail('kavya@system.in','Trailhead Trigger Tutorial',  recordcount+'contact(s) were inserted.');
    }else if(Trigger.isDelete){
        Integer recordcount = Trigger.new.size();
        
    }
public class Cus_Inv_Exmp1 {
    public static void callMe(List<APEX_Customer__c> customers )
    {  
        List<APEX_Invoice__c> InvoiceList=new List<APEX_Invoice__c>();
        for(APEX_Customer__c objCust:customers)
        {   
            if(objCust.APEX_Customer_Status__c=='Active')
            {
                APEX_Invoice__c objInvoice=new APEX_Invoice__c();
                objInvoice.APEX_Status__c='Active';
                objInvoice.APEX_Description__c='Recored created through trigger';
                objInvoice.APEX_Customer__c=objCust.id;
                InvoiceList.add(objInvoice);
                
            }
            
        }
      Insert  InvoiceList;//DML
    }
}


Callout for Trigger :

trigger Cus_Inv_Exmp1 on APEX_Customer__c (after update)
{

     Cus_Inv_Exmp1.callMe(Trigger.new);   
}
I am not able to go through the Business Administration Specialist challenge 1. In challenger it says that I didn't import  the file. Bu I did everthing. Help me to pass this challenge.
Modify an AppExchange dashboard
Maria Jimenez is looking for reports and dashboards on AppExchange to track her team's transition to Lightning Experience. Install the AppExchange Dashboard Pack for Sales, Marketing and Service package into your Trailhead Playground and make some modifications. 

You’ll need your hands-on org username and password to complete this challenge. If you're using a Trailhead Playground, this article shows you how to find your username and reset your password. If you have trouble installing the package, follow the steps in this article.

In your Trailhead Playground, install the AppExchange Dashboard Pack for Sales, Marketing and Service.
Clone the 1-Account, Contact & Opportunity Data Quality dashboard and name it My Account and Contact Dashboard.
Add a dashboard filter on the Billing City field so that the dashboard only shows info about Accounts in London.
Save and refresh the dashboard.

I am trying to complete this challenge from past 4 hours still am not able to do it. Please help me guys! Guide me!!!!
I have successfully installed Data Loader on my system. When am trying to open, it is asking me to install Java Run time environment (32 bit). I have tried hard to get the link from internet. But no luck it shows that I have installed the app but the Java is still not getting opened. Unless and until I fix this issue, I won't be able to open the Data Loader. Please help me in resolving this issue.
Test Your Process
Check the Process
If everything works correctly, whenever an account has a change of address, the address change is made for everyone who works for that company. Let’s test that.
Click  to open the App Launcher. Select Contacts.
Click Recently Viewed and select the All Contacts list, then click Tim Barr.
On Tim Barr’s contact record, click Details.
On Tim Barr’s detail page, note the mailing address [1] and account name [2]. 
Click the account name, Grand Hotels & Resorts Ltd. This opens the account for Grand Hotels & Resorts Ltd.
On the Grand Hotels & Resorts Ltd. account record, click Details.
Click Edit.
Change the billing street address and click Save.
Click Related.
Scroll down to Contacts and click Tim Barr. Click Details. On his detail page, notice that his mailing address has been updated.
Here is my program:

public class Outbound_Example_3 {
    public void invoke(){
        Messaging.SingleEmailMessage msg =new Messaging.SingleEmailMessage();
        Contact con=[select id ,AccountId from Contact where createdDate=TODAY];
        msg.setTargetObjectId(con.Id);
        msg.setWhatId(con.AccountId);
        EmailTemplate et =[select id from EmailTemplate where name='Case Response'];
        msg.setTemplateId(et.id);
        
        Document doc =[select id,Name,Body,ContentType ,Type from Document where name='Email Messaging'];
        Messaging.EmailFileAttachment eft1 =new Messaging.EmailFileAttachment();
        eft1.setFileName(doc.Name+doc.type);
        eft1.setBody(doc.body);
        eft1.setContentType(doc.ContentType);
        
        PageReference p=Page.EmailSerc;
        Blob body=p.getContentAsPDF();
        Messaging.EmailFileAttachment eft2 =new Messaging.EmailFileAttachment();
        eft2.setFileName('EmailSerc');
        eft2.setBody(body);
        List<Messaging.EmailFileAttachment> files =new List<Messaging.EmailFileAttachment>{eft1,eft2};
        msg.setFileAttachments(files);
        Messaging.Email[] emails =new Messaging.Email[]{msg};
        Messaging.sendEmail(emails);    
        
    }
}


Outbound_Example_3 ou=new Outbound_Example_3();
ou.invoke();


Please let me know where am I going wrong.
Thanks!
Hello,

I am a 'Ranger' now and I want to know when will I get my hoodie !!!

 
My question is: When ever lead is inserted, with leadsource as web set wilson as owner of record. If the leadsource is other than web then assign it to lifeQueue as owner.

Ans:

public class Lead_Example {
    
    User u= [Select id from User where FirstName LIKE 'wilson'];
    group g= [Select id from Group where type='Queue' and name='LifeQueue'];
    public static void callMe(List<Lead> leads) 
    {
        for(Lead l: leads)
        {
            if(l.LeadSource=='web')
            {
                l.OwnerId= u.id;
            }else{
                l.OwnerId=g.id;
            }
        }
    }
}

Trigger Callout:
trigger Lead_Example on Lead (before insert) {
    List<Lead> leads=Trigger.new;
    
    Lead_Example.callMe(Trigger.new);
    
}

}Please Help!!!!!


In the above example, I need to write a trigger in such a way that whenever I create a new contact an email should be sent to me with the details also the count of number of triggers.

I have written this class for the above example:

public class EmailManager {
    public static void sendMail(List<contact> contacts)
    {
        for(Contact c: contacts)
        {
            if(c.email!=null)
            {
                c.email='kavya@system.in';
            }
        }
  
    }
    

}

This is the trigger:

trigger ExampleTrigger on Contact (after insert,after delete) {
    list<contact> contact= Trigger.new;
    if(Trigger.isInsert){
        Integer recordcount= Trigger.new.size();
        EmailManager.sendMail('kavya@system.in','Trailhead Trigger Tutorial',  recordcount+'contact(s) were inserted.');
    }else if(Trigger.isDelete){
        Integer recordcount = Trigger.new.size();
        
    }
public class Cus_Inv_Exmp1 {
    public static void callMe(List<APEX_Customer__c> customers )
    {  
        List<APEX_Invoice__c> InvoiceList=new List<APEX_Invoice__c>();
        for(APEX_Customer__c objCust:customers)
        {   
            if(objCust.APEX_Customer_Status__c=='Active')
            {
                APEX_Invoice__c objInvoice=new APEX_Invoice__c();
                objInvoice.APEX_Status__c='Active';
                objInvoice.APEX_Description__c='Recored created through trigger';
                objInvoice.APEX_Customer__c=objCust.id;
                InvoiceList.add(objInvoice);
                
            }
            
        }
      Insert  InvoiceList;//DML
    }
}


Callout for Trigger :

trigger Cus_Inv_Exmp1 on APEX_Customer__c (after update)
{

     Cus_Inv_Exmp1.callMe(Trigger.new);   
}
I am not able to go through the Business Administration Specialist challenge 1. In challenger it says that I didn't import  the file. Bu I did everthing. Help me to pass this challenge.
Modify an AppExchange dashboard
Maria Jimenez is looking for reports and dashboards on AppExchange to track her team's transition to Lightning Experience. Install the AppExchange Dashboard Pack for Sales, Marketing and Service package into your Trailhead Playground and make some modifications. 

You’ll need your hands-on org username and password to complete this challenge. If you're using a Trailhead Playground, this article shows you how to find your username and reset your password. If you have trouble installing the package, follow the steps in this article.

In your Trailhead Playground, install the AppExchange Dashboard Pack for Sales, Marketing and Service.
Clone the 1-Account, Contact & Opportunity Data Quality dashboard and name it My Account and Contact Dashboard.
Add a dashboard filter on the Billing City field so that the dashboard only shows info about Accounts in London.
Save and refresh the dashboard.

I am trying to complete this challenge from past 4 hours still am not able to do it. Please help me guys! Guide me!!!!