public with sharing class CampaignRelationshipController {
|
|
public string campaignId {get; set;}
|
public List<CampaignRelationship__c> CRList {get; set;}
|
public List<CampaignRelationship__c> RVICRList {get; set;}
|
public List<CampaignRelationship__c> NDTCRList {get; set;}
|
public List<CampaignRelationship__c> ANICRList {get; set;}
|
public List<CampaignRelationship__c> IECRList {get; set;}
|
|
public String baseUrl { get; set; }
|
|
public CampaignRelationshipController(){
|
|
baseUrl = URL.getSalesforceBaseUrl().toExternalForm();
|
String path = URL.getCurrentRequestUrl().getPath();
|
if (path.indexOf('/apex') > 0) {
|
baseUrl += path.substring(0, path.indexOf('/apex'));
|
}
|
campaignId = System.currentPageReference().getParameters().get('campaignId');
|
|
|
}
|
|
public CampaignRelationshipController(ApexPages.StandardController controller) {
|
campaignId = controller.getRecord().Id;
|
system.debug('campaignId---->'+campaignId);
|
|
baseUrl = URL.getSalesforceBaseUrl().toExternalForm();
|
String path = URL.getCurrentRequestUrl().getPath();
|
if (path.indexOf('/apex') > 0) {
|
baseUrl += path.substring(0, path.indexOf('/apex'));
|
}
|
|
}
|
|
public PageReference init() {
|
|
CRList = new List<CampaignRelationship__c>();
|
CRList = [SELECT Id,Name,RelationshipAccount__c,RelationshipAccount__r.Name,
|
RelationshipAccountStatus__c,RelationshipProductSegment__c,
|
RelationshipCampaign__c,ManagementCode__c
|
FROM CampaignRelationship__c
|
WHERE RelationshipCampaign__c = :campaignId Order by Id];
|
|
|
RVICRList = new List<CampaignRelationship__c>();
|
NDTCRList = new List<CampaignRelationship__c>();
|
|
ANICRList = new List<CampaignRelationship__c>();
|
|
IECRList = new List<CampaignRelationship__c>();
|
if (CRList.size() > 0) {
|
for (CampaignRelationship__c cr:CRList) {
|
if (cr.RelationshipProductSegment__c == 'RVI') {
|
RVICRList.add(cr);
|
} else if (cr.RelationshipProductSegment__c == 'NDT') {
|
NDTCRList.add(cr);
|
} else if (cr.RelationshipProductSegment__c == 'ANI') {
|
ANICRList.add(cr);
|
} else if (cr.RelationshipProductSegment__c == 'IE') {
|
IECRList.add(cr);
|
}
|
}
|
}
|
return null;
|
}
|
|
|
public PageReference DataLoadAccount(){
|
|
PageReference ref = new Pagereference(baseUrl +'/apex/DataLoadAccount?campaignId=' + campaignId);
|
ref.setRedirect(true);
|
return ref;
|
//return null ;
|
}
|
|
//public PageReference UnabletoEdit() {
|
// PageReference ref = new Pagereference('/apex/TSRepair?Id=' + repairId);
|
// ref.setRedirect(true);
|
// return ref;
|
// }
|
}
|