I have a search box that will pull into all accounts we currently have. It will then direct to a custom record detail page that shows account's main information with the equipment they currently have( related list) when you click "view info"
my search visualforce page uses a controller to query by email:
public void searchcontroller( ) {
}
public void search(){
string searching='select id, Name, PersonEmail, BillingStreet,
BillingCountry, BillingCity, BillingState, BillingPostalCode,
PersonHomePhone from account where PersonEmail like
\'%'+searchstring+'%\' Limit 10';
acc= Database.query(searching);
}
public void clear(){
acc.clear();
}
}
but my second visualforce page uses the standardcontroller for "Account" and an extension "EquipmentInfoController":
public with sharing class EquipmentInfoController {
private Account account;
private list<equipment__c> equip;
public equipmentInfoController(ApexPages.StandardController
controller) {
this.account= (Account)controller.getRecord();
}
public List<equipment__c> returnEquip()
{
equip = [select id, Name, gear__c, account__r.Name,
account__r.PersonEmail from Order__c Where
account__r.id=:account.id];
return equip;
}
}
I am able to pass the account id from the search VF page to the Equipment Info page and see all of the accounts info and the equipment they currently have, but how do I combine both apex classes into one class? Or do I need to use two separate classes since one visualforce page uses a standard controller?