• Sashibansal
  • NEWBIE
  • 0 Points
  • Member since 2013

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

Hi

 

I have created an html email template according to the requirement

i need to display the check box value for one field i.e.

  •     Was the trainer present (yes, if checked – no, if unchecked),

i have done this way Was the GAP Card Site reviewed: (yes, if checked – no, if unchecked

                              {!if(!Visit__c.traine attended ''Yes'', "No")} its not working

kindly help me in displaying the checkbox value...

 

 

 

Thankls in advance

sashi

Hi team,

 

I am wrting a Trigger to send an email whenever a Visit__c (custom object) record is created. Visit__c has a custom field named Poc_1_c which is nothing but a look up to contact.

So now when I create a Visit record the email should go to the POC.

Below is the Trigger I wrote and the error I am getting

 

trigger Send_Email_Visit on Visit__c (after insert,after update) {

Set<Id> Poc1IdSet = new Set<Id>();
  for(Visit__c Visit :Trigger.new){
  Poc1IdSet.add(Visit.POC_1__c);
  List<String> List1 = new List<String> ([Select Email from Contact where id in :Poc1IdSet]);
     
  Messaging.SingleEmailMessage MessageEmail = new Messaging.SingleEmailMessage();
 
   String toaddress = new String[] {List1.Email};
  
  
   if(Visit.Send_Email__c ==True && Visit.Portfolio__c =='Walmart')
        {
        MessageEmail.setTemplateId('00XK0000000QN37');
        MessageEmail.setTargetObjectId(Visit.CreatedByID);
        MessageEmail.setToAddresses (toaddress);
        MessageEmail.setSaveAsActivity(False);
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] {MessageEmail});
        }
        }
   
   }

Error: Compile Error: Invalid initial value type LIST<Contact> for LIST<String> at line 6 column 24

 

Can ANyone please help me on this?

 

Thanks in advance

Hi team,

 

I am wrting a Trigger to send an email whenever a Visit__c (custom object) record is created. Visit__c has a custom field named Poc_1_c which is nothing but a look up to contact.

So now when I create a Visit record the email should go to the POC.

Below is the Trigger i wrote and the error i am getting

 

trigger Send_Email_Visit on Visit__c (after insert,after update) {

Set<Id> Poc1IdSet = new Set<Id>();
  for(Visit__c Visit :Trigger.new){
  Poc1IdSet.add(Visit.POC_1__c);
  List<String> List1 = new List<String> ([Select Email from Contact where id in :Poc1IdSet]);
     
  Messaging.SingleEmailMessage MessageEmail = new Messaging.SingleEmailMessage();
 
   String toaddress = new String[] {List1.Email};
  
  
   if(Visit.Send_Email__c ==True && Visit.Portfolio__c =='Walmart')
        {
        MessageEmail.setTemplateId('00XK0000000QN37');
        MessageEmail.setTargetObjectId(Visit.CreatedByID);
        MessageEmail.setToAddresses (toaddress);
        MessageEmail.setSaveAsActivity(False);
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] {MessageEmail});
        }
        }
   
   }

Error: Compile Error: Invalid initial value type LIST<Contact> for LIST<String> at line 6 column 24

 

Can ANyone please help me on this?

 

Thanks in advance

Hi team,

 

I am wrting a Trigger to send an email whenever a Visit__c (custom object) record is created. Visit__c has a custom field named Poc_1_c which is nothing but a look up to contact.

So now when I create a Visit record the email should go to the POC.

Below is the Trigger I wrote and the error I am getting

 

trigger Send_Email_Visit on Visit__c (after insert,after update) {

Set<Id> Poc1IdSet = new Set<Id>();
  for(Visit__c Visit :Trigger.new){
  Poc1IdSet.add(Visit.POC_1__c);
  List<String> List1 = new List<String> ([Select Email from Contact where id in :Poc1IdSet]);
     
  Messaging.SingleEmailMessage MessageEmail = new Messaging.SingleEmailMessage();
 
   String toaddress = new String[] {List1.Email};
  
  
   if(Visit.Send_Email__c ==True && Visit.Portfolio__c =='Walmart')
        {
        MessageEmail.setTemplateId('00XK0000000QN37');
        MessageEmail.setTargetObjectId(Visit.CreatedByID);
        MessageEmail.setToAddresses (toaddress);
        MessageEmail.setSaveAsActivity(False);
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] {MessageEmail});
        }
        }
   
   }

Error: Compile Error: Invalid initial value type LIST<Contact> for LIST<String> at line 6 column 24

 

Can ANyone please help me on this?

 

Thanks in advance