• Tamil Selvan 5
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Is there a way to combine both these classes(Account & Case)  into one so i there isn't two seperate classes in my org? I'm not sure how to accimplish this and could use help.

Account class
Public Class VF_SiteServicePartnerAllController{
   private Account acc;
   public List<Site_Service_Partner__c> sspList {get;set;}
   
   public VF_SiteServicePartnerAllController(ApexPages.StandardController sp){
       acc = (Account)sp.getRecord();
       sspList = new List<Site_Service_Partner__c>();
       sspList = [SELECT Id,Name,Site_Account__c,Primary_Field_Contact__c,Service_Partner__c,
                  Service_Partner_Owner__c,Service_Partner_Owner_Mobile__c,Service_Partner_Owner_Email__c,
                  Primary_Field_Email__c,Primary_Field_Mobile__c,Service_Partner_Site_Status__c, 
                  Contracted_Services__c,Secondary_Field_Contact__c,Secondary_Field_Email__c,Secondary_Field_Mobile__c,
                  Service_Partner_Start_Date__c,Service_Partner_End_Date__c,Service_Partner_Main_Phone__c,Trade__c,Supported_Trade__c,trade_value__c  FROM Site_Service_Partner__c WHERE Site_Account__c =: acc.Id    AND  Trade__c IN ('Land', 'Snow', 'Land;Snow') AND Service_Partner_Site_Status__c = 'Active'];

    
    Set<Id> bidId = new  Set<Id>();  
    for(Site_Service_Partner__c bs:sspList){
       bidId.add(bs.Id);
    }
     
   }

}

Case class
//Used on the Case object updated 1-31-2020
Public Class VF_CaseServicePartExtController{
private Case css;
   public List<Site_Service_Partner__c> cseList {get;set;}
   
   public VF_CaseServicePartExtController(ApexPages.StandardController sp){
       css= (Case)sp.getRecord();
       cseList = new List<Site_Service_Partner__c>();
       cseList = [SELECT Id,Name,Case__c,Site_Account__c,Primary_Field_Contact__c,Service_Partner__c,
                  Primary_Field_Email__c,Primary_Field_Mobile__c,Service_Partner_Site_Status__c, Contracted_Services__c,
                  Secondary_Field_Contact__c,Secondary_Field_Email__c,Secondary_Field_Mobile__c,Service_Partner_Owner__c,
                  Trade__c,Supported_Trade__c  FROM Site_Service_Partner__c WHERE Case__c =: css.Id AND Trade__c includes('Land','Snow','Land;Snow') AND Service_Partner_Site_Status__c='Active' ];
    
    Set<Id> bidId = new  Set<Id>();  
    for(Site_Service_Partner__c bs:cseList){
       bidId.add(bs.Id);
    }
     
   }
 

}


 
  • February 20, 2020
  • Like
  • 0