You need to sign in to do that
Don't have an account?
Rajashri
Set Parameter Value to test the code
Hi
How can i set the parameter value in controller to Test my below code.
public with sharing class singleListView {
public Campaign camp {get; set; }
Public Lead lead{get;set;}
List<CampaignMember> CampaignMember = new List<CampaignMember>();
public singleListView(ApexPages.StandardController controller) {
camp = (Campaign)controller.getRecord();
System.debug(camp.Id);
}
public List<Schema.Lead> CampaignMembers;
public List<Schema.Lead> getCampaignMembers() {
System.debug(camp.Id);
CampaignMembers=[Select Id,Name,(Select id, Campaign.Name,Contact.Phone,Lead.FirstName,Lead.LastName,LeadID,Lead.Phone,Lead.Email, Lastmodifieddate,Status,CampaignId,Campign_ID__c,Lead.MobilePhone From CampaignMembers where CampaignId =:camp.Id and Status != '' and LeadId != null),
(Select Subject, Id,lastModifiedDate From ActivityHistories where lastModifiedDate !=null and Subject !=null order by LastModifiedDate desc limit 1)
From Lead where Name !=NULL and Id='00Q90000008fA5OEAU' order by LastModifiedDate desc];
return CampaignMembers;
}
}
How can i set the parameter value in controller to Test my below code.
public with sharing class singleListView {
public Campaign camp {get; set; }
Public Lead lead{get;set;}
List<CampaignMember> CampaignMember = new List<CampaignMember>();
public singleListView(ApexPages.StandardController controller) {
camp = (Campaign)controller.getRecord();
System.debug(camp.Id);
}
public List<Schema.Lead> CampaignMembers;
public List<Schema.Lead> getCampaignMembers() {
System.debug(camp.Id);
CampaignMembers=[Select Id,Name,(Select id, Campaign.Name,Contact.Phone,Lead.FirstName,Lead.LastName,LeadID,Lead.Phone,Lead.Email, Lastmodifieddate,Status,CampaignId,Campign_ID__c,Lead.MobilePhone From CampaignMembers where CampaignId =:camp.Id and Status != '' and LeadId != null),
(Select Subject, Id,lastModifiedDate From ActivityHistories where lastModifiedDate !=null and Subject !=null order by LastModifiedDate desc limit 1)
From Lead where Name !=NULL and Id='00Q90000008fA5OEAU' order by LastModifiedDate desc];
return CampaignMembers;
}
}
NOTE: This code has not been tested and may contain typographical or logical errors