• ARUL BERNARD I 6
  • NEWBIE
  • 10 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 1
    Replies
Error: wrapperExample Compile Error: Constructor not defined: [wrapperExample.Wrapper].<Constructor>(Contact, Lead) at line 15 column 21

Hi, 
Please Help me out

public class wrapperExample{

 
  public List<Wrapper> wrapContactList{get; set;}

 public wrapperExample(){
  if(wrapContactList== null) {
  wrapContactList= new List<Wrapper>();
  List<lead> ledlist = [select Email from lead];
  for(Contact c: [select Email from contact]) {

          for(lead l: ledlist ){
          if(c.Email == l.Email){

wrapContactList.add(new Wrapper(c,l));
}
 
  }   
  }
  }
  }

 public class Wrapper{


  public contact con{get; set;}
  public lead  led{get; set;}

 public Wrapper(Lead a,Contact c) {
  led = a;
  con = c;

 }
  }
 }
Hi Please help me out to solve this problem.
public class wrapperExample{

 
  public List<Wrapper> wrapAccountList {get; set;}

 public wrapperExample(){
  if(wrapAccountList == null) {
  wrapAccountList = new List<Wrapper>();
  for(Account a: [select Id, Name,BillingState, Website, Phone from Account limit 100]) {

          for(list<contact> r: [select Id, Name from Contact where AccountId = :a.Id]){

wrapAccountList.add(new Wrapper(a,r));
 
  }   
  }
  }
  }

 public class Wrapper{

 public Account acc {get; set;}
  public List<Contact> con {get; set;}

 public Wrapper(Account a, List<Contact> c) {
  acc = a;
  con = c;

 }
  }
 }
Hi,
    I have a rating field in contact and overall rating filed in the account. If I added a new account or update the rating field it should sum and update in overall rating this my scenario.How to write a test class for this code.
Apex code:
trigger Overallrating on Contact (after insert,after update,after delete,after undelete){
    
    Set<Id> accIdset = new Set<Id>();
    
    if(trigger.isinsert || trigger.isUpdate || trigger.isundelete){
        for(contact con : trigger.new)
        {
            if(con.AccountId != null)
            {
                accIdset.add(con.AccountId); 
            }
        }
    }
    
    else if(trigger.isdelete)
    {  
        for(contact con : trigger.old)
        {
            if(con.AccountId != null)
            {
              accIdset.add(con.AccountId);
            }
        }
    
    }  
    
    
    account acc=new account();
        
      List<AggregateResult>  lstAggregation = new list<AggregateResult>();
      List<Account> overallrating = new List<Account>();
      
      
      for(AggregateResult ar: [select sum(Rating__c) ratid,count(id) countid,AccountId accId from contact where accountid = :accIdset group by AccountId]){
           
           acc.id = String.valueof(ar.get('accId'));
           acc.Over_all_Rating__c = Integer.valueOf(ar.get('ratid'));
           acc.Number_of_Contact__c = Integer.valueOf(ar.get('countid'));
           overallrating.add(acc);
          
           
           
           
           System.debug('<<>>'+overallrating);
            
        }
      
    update overallrating;
    
}


 
 I have created the following javascript code but still in error 

{!REQUIRESCRIPT("/soap/ajax/39.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/39.0/apex.js")}

var emailAddresses = '';
var template_name = 'Congrz Mail';

var customRecord = sforce.connection.query("SELECT id,contact.Email FROM OpportunityContactRole WHERE Id ='"+ '{!Opportunity.Id}'
+"'");

emailAddresses = customRecord.records.Email;

var email_template = sforce.connection.query("SELECT id FROM EmailTemplate WHERE name ='"+ template_name+"'");

var templateid= email_template.records.Id;

location.replace('/email/author/emailauthor.jsp?&p24={!customRecord .Email}&template_id=00X6F000001Ge1kUAC&p3={!customRecord .Name}&p26={!customRecord .Email}&p2={!customRecord .Id}');

 
I am using custom link button to send email to the person based on email field.
I would like to create a validation rule to prevent a record from being saved if the time is after X.  I have attempted this, but I can't see where I can reference the current time.  Any ideas?


AND (
ISPICKVAL (  Status__c , "Submitted" ),
Due_Date__c  =  TODAY() ,
Current time  <=  4 pm 
)
I have divided 24 hours in to 12 parts(12:00AM to 02:00Am,02:00AM to 04:00AM,04:00AM to 06:00AM,06:00AM to 08:00AM,08:00AM to 10:00AM,10:00Am to 12:00PM,12:00PM to 02:00pm,02:00pm to 04:00pm,04:00pm to 06:00pm,06:00pm to 08:00pm,08:00pm to 10:00pm,10:00pm to 12:00pm)
If the value is inserted  in (12:00Am to 02:00AM)text box it should check with the system time if the time is 12am to 2am it should allow to insert the record.vise versa for all the field how to implement this using formula field 
 
Hi Please help me out to solve this problem.
public class wrapperExample{

 
  public List<Wrapper> wrapAccountList {get; set;}

 public wrapperExample(){
  if(wrapAccountList == null) {
  wrapAccountList = new List<Wrapper>();
  for(Account a: [select Id, Name,BillingState, Website, Phone from Account limit 100]) {

          for(list<contact> r: [select Id, Name from Contact where AccountId = :a.Id]){

wrapAccountList.add(new Wrapper(a,r));
 
  }   
  }
  }
  }

 public class Wrapper{

 public Account acc {get; set;}
  public List<Contact> con {get; set;}

 public Wrapper(Account a, List<Contact> c) {
  acc = a;
  con = c;

 }
  }
 }