Advertisement
Guest User

apexController2

a guest
Apr 27th, 2015
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. public with sharing class ContactController{
  2.  
  3. public String selectedContactId {
  4. set;get;
  5. }
  6.  
  7. public ContactController(ApexPages.StandardSetController controller) {
  8. }
  9.  
  10. public void LoadContactData() {
  11. Time__c cont = (Time__c) controller.getRecord();
  12. selectedContactId = [SELECT Id, Project__r.Name, Task__r.Name, Billing_Rule__r.Non_Billable__c, Time_Spend__c FROM Time__c WHERE id=:cont.Primary_Contact__c];
  13. }
  14.  
  15. public List<SelectOption> getListOfContacts(){
  16. List<Contact> Contacts = [SELECT Id, Name FROM Contact] ;
  17. List<SelectOption> ContactOptionList = new List<SelectOption>();
  18. ContactOptionList.add(new SelectOption( ' ' ,'---Select---'));
  19.  
  20. for(Contact c : Contacts ) {
  21. ContactOptionList.add(new SelectOption(c.Id , c.Name));
  22. }
  23.  
  24. return ContactOptionList ;
  25. }
  26. public contactController(){
  27. selectedContactId ='';
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement