• Akshay Deshmukh
  • NEWBIE
  • 260 Points
  • Member since 2014

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 48
    Replies
Hi all,

I'm using pageBlockTable to display rows of an inner class in my controller. Now, I also want every row to have an option to be deleted. I found solutions online similar to http://sfdcsrini.blogspot.com/2014/12/adding-and-deleting-rows-dynamically-in.html . But I would like to avoid using apex:variable because I think it's not that straightforward. So I tried to use a Map instead of a List of Row objects where the keys are the rowId of the Row objects. 

Here's my controller code:
public class TestInputController {
    
    public Map<Integer, Row> rows { get; set; }
    
    public TestInputController() {
        rows = new Map<Integer, Row>();
    }
    
    public void addRow() {
        Integer rowId = rows.size();
        rows.put(rowId , new Row(rowId));
    }
    
    public void removeRow() {
        rows.remove(Integer.valueOf(ApexPages.currentPage().getParameters().get('rowIdToRemove')));
    }
    
    public class Row {
        public Integer rowId { get; set; }
        public Row(Integer rowId) {
            this.rowId = rowId;
        }
    }

}

And here's my visualforce code:
<apex:page controller="TestInputController" docType="html-5.0">
    <apex:form >        
        <apex:pageBlock >
            <apex:pageBlockSection >
                <apex:pageBlockTable value="{!rows}" var="rid" id="tablet">
                    <apex:column headerValue="ID">
                        <apex:input type="number" value="{!rows[rid].rowId}" />
                    </apex:column>
                    <apex:column headerValue="Action">
                        <apex:commandButton action="{!removeRow}" value="x" rerender="tablet">
                            <apex:param value="{!rows[rid].rowId}" name="rowIdToRemove" />
                        </apex:commandButton>
                    </apex:column>
                </apex:pageBlockTable>
                <apex:pageBlockSectionItem >
                    <apex:commandButton value="Add Row" action="{!addRow}" rerender="tablet"/>
                </apex:pageBlockSectionItem>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

Unfortunately, when I try to save the VisualForce page, I get the error:
Error: Expected input type 'text', got 'number' for Id data type

I figured that this is the line that caused the error:
<apex:input type="number" value="{!rows[rid].rowId}" />

I know that I can go back to the solution I found online regarding deleting rows, but I just don't get it why I'm getting this error. When I was using Lists before, the line
<apex:input type="number" value="{!row.rowId}" />
works (where row is the var name i used in the pageBlockTable). Am I missing something here? Or is this a bug?

Thanks,
Mishael
Hi all,

i am trying to align my command button in center but its not working i have used all the css properties like align and float in my output panel but still its not working

<apex:page controller="VistAudit_VFC" action="{!createData}">
 <apex:form >
  <apex:outputLabel value="Audit Visit" style="font-family:Times New Roman;font-size:15px">
 </apex:outputLabel><br></br>
 
<apex:outputPanel style="float:centre">
 <apex:commandButton value="Save" action="{!save}"/>
 </apex:outputPanel>

</apex:page>

any help would be appreciated

thanks
I have two objects A and B. A has a text filed (contact_name__c) and B has a look-up field(contact_name__c). Now I want to copy the look-up value (contact name not Id) to object A's text field

objectA.contact_name__c = ObjectB.Contact_name__c.Name;

but this give foreign key error
I also tried this
objectA.contact_name__c = ObjectB.Contact_name__r.Name;
this compiles but gives run-time error that sObject retrieved via SOQL without retrieving requested field..
I dont want to use formula field. i found some workaround that first fire select query to get contact name than assign to it. Is there some other way?

Hello All,

I have one scenerios in which we have to get the current id of record on clicking "Edit"(Command Link).For this i use  a <apex:param> but its not working.Please review my code and let me know my error. I am pasting my Code as follow:-\


<apex:page controller="ContactWithAccount">
    <apex:form  id="form">
  Account <apex:inputField value="{!objContact.Accountid}"/>
 <apex:commandButton  action="{!getContact}" title="Get Contact" value="Get Contact"/> 
 
  
      <apex:pageBlock id="hiddenBlock">
          <apex:pageBlockTable value="{!lstContact}" var ="Con">
              <apex:column>
                  <apex:commandLink value="Edit" action="{!edit}" />|<apex:commandLink value="Delete" action="{!deletevalue}"/>
                      <apex:param value="{!Con.id}" assignTo="{!Selectedid}"/>
              </apex:column>
              
              
              <apex:column value="{!Con.Name}"/> 
          
          
          </apex:pageBlockTable>
          
      
      
      </apex:pageBlock>
  
  </apex:form>
</apex:page>

And My Controller is as follows:-


public class ContactWithAccount{
    public Contact objContact{get;set;}
    public List<Contact>lstContact{get;set;}
    public String Selectedid{get;set;}
    public List<Contact>lstContact1{get;set;}
    
    
    public ContactWithAccount(){
        objContact = new Contact();
        lstContact = new List<Contact>();
        lstContact1 = new List<Contact>();
    
    
    }
    public void getContact(){
       lstContact = [select Name from contact where AccountId =:objContact.AccountId];
           
     }
     public void edit(){
          lstContact1 = [select Name from contact where AccountId =:Selectedid];
          for(Contact objCon :lstContact1 ){
              if(objCon.id ==Selectedid )
              {
                  
              
              
              }
              System.debug('_______________lstContact1_____________________________________________'+lstContact1);
               System.debug('_______________Selectedid_____________________________________________'+Selectedid);
          
          }
     
     
     }
     public void deletevalue(){
         
     
     
     } 
     



}

Currently  getting value of "   System.debug('_______________Selectedid_____________________________________________'+Selectedid); "
is "null"

Awaiting for your replies!!!
Thanks in advance.

I have a requirement wherein I have to make a callout upon Pageload. 
The continuation request method is getting invoked, but not the callback.
The response is not getting displayed.

Steps to replicate the same:
1) I'm calling a controller method from action attribute of <apex:page> 
2) From that method I'm calling the continuation method.
3) For some reason, But the call back method is not getting invoked.

PS: The same thing is working if I call from a command button with render attribue

Any help/pointers would be highly appreciated.
Many Thanks!
 
Challenge - Create a form to enter new items and display the list of items entered. To make our camping list look more appealing, change the campingHeader component to use the SLDS. Similar to the unit, style the Camping List H1 inside the slds-page-header. Modify the campingList component to contain an input form and an iteration of campingListItem components for displaying the items entered.
The component requires an attribute named items with the type of an array of camping item custom objects.
The component requires an attribute named newItem of type Camping_Item__c with default quantity and price values of 0.
The component displays the Name, Quantity, Price, and Packed form fields with the appropriate input component types and values from the newItem attribute.
The JavaScript controller checks to ensure that the Name, Quantity and Price values submitted are not null.
If the form is valid, the JavaScript controller pushes the newItem onto the array of existing items, triggers the notification that the items value provider has changed, and resets the newItem value provider with a blank sObjectType of Camping_Item__c.


My answer - 
<aura:component >
<aura:attribute name="items" type="Camping_Item__c[]"/>
<aura:attribute name="newitem" type="Camping_Item__c[]"  default="{ 'sobjectType': 'Camping_Item__c',
                   'Quantity__c'=0, 'Price__c'=0}"/>
 <p>Name:
        <ui:inputText value="{!v.newitem.name}"/>
    </p>    
  <p>Packed:
        <ui:inputCheckbox value="{!v.newitem.Packed__c}"/>
     
    </p>    
  <p>Price:
        <ui:inputCurrency value="{!v.newitem.Price__c}"/>
    </p>
    <p>Quantity:
        <ui:inputNumber value="{!v.newitem.Quantity__c}"/>
    </p>
</aura:component>


Error -

Challenge Not yet complete... here's what's wrong: 
The campingList component isn't iterating the array of 'items' and creating 'campingListItem' components.

Please share the correct solution.
All - I created a wizard in visual force on a page called opptyStep1. I then assigned this page as the homepage on my site. 
Here's the issue: the preview screen of the page looks perfect but when I click on the site, two of the fields are not showing correctly: one is supposed to be a dropdown menu (Investment Strategy), the other a checkbox (active__c). The check box doesnt even show.  Any ideas?  The code is below

<apex:page sidebar="false" standardstylesheets="false" showheader="false" controller="newOpportunityController"
           tabStyle="Opportunity">
           <apex:image value="http://i723.photobucket.com/albums/ww231/sumtuck1/la-investments-v2-intrlcd-nav_zpsumlix1ia.png"/>
 <apex:sectionHeader title="Step 1 of 3: Personal Information"
                     />
  <apex:form >
    <apex:pageBlock title="Open a NSRi Account">

      <!-- This facet tag defines the "Next" button that appears
           in the footer of the pageBlock. It calls the step2()
           controller method, which returns a pageReference to
           the next step of the wizard. -->  
    
      <apex:facet name="footer">
        <apex:commandButton action="{!step2}" value="Next"
                            styleClass="btn"/>
      </apex:facet>
    

      <!-- <apex:panelGrid> tags organize data in the same way as
            a table. It places all child elements in successive cells,
            in left-to-right, top-to-bottom order -->  
    
      <!-- <apex:outputLabel > and <apex:inputField > tags can be
            bound together with the for and id attribute values,
            respectively. -->  
    
      
     
    
       <apex:panelGrid columns="2">
         <apex:outputLabel value="First Name"
                           for="contactFirstName"/>
         <apex:inputField id="contactFirstName"
                          value="{!contact.firstName}"/>
         <apex:outputLabel value="Last Name" for="contactLastName"/>
         <apex:inputField id="contactLastName"
                          value="{!contact.lastName}"/>
         <apex:outputLabel value="Phone" for="contactPhone"/>
         <apex:inputField id="contactPhone"
                          value="{!contact.phone}"/>
           <apex:outputLabel value="Email"
                           for="accountPersonEmail"/>
          <apex:inputField id="accountPersonEmail"
                          value="{!account.personEmail}"/>
         <apex:outputLabel value="Date of Birth"
                           for="contactBirthdate"/>
          <apex:inputField id="contactBirthdate"
                          value="{!contact.birthdate}"/>
          <apex:outputLabel value="Social Security Number"
                           for="contactSocial_Security_Tax_ID__c"/>
          <apex:inputField id="contactSocial_Security_Tax_ID__c"
                          value="{!contact.Social_Security_Tax_ID__c}"/>
                           <apex:outputLabel value="Investment Strategy"
                            for="opportunityInvestment_Strategy__c"/>
          <apex:inputField id="opportunityInvestment_Strategy__c"
                           value="{!opportunity.Investment_Strategy__c}"/>
          <apex:outputLabel value="Initial Investment Amount"
                            for="opportunityAmount"/>
          <apex:inputField id="opportunityAmount"
                           value="{!opportunity.amount}"/>
          <apex:outputLabel value=""
                            for="opportunityActive__c"/>
          <apex:inputField id="opportunityActive__c"
                           value="{!opportunity.Active__c}"/>
                         
        
       </apex:panelGrid>
 
    </apex:pageBlock>
  </apex:form>
</apex:page>
 
I am getting following error while sending email to Emailservice

(Undelivered): 554 common.apex.runtime.ParseException  What would be the problem.

The code was running perfectly till last Friday 21-Mar-2015. I haven't change anything in code since then, but it's not working since two days; stange behaviour. Although even If I had any problem in my code, email should receive in Salesforce and then I can use debug log to see any code exception but I am receiving bounce back email with above error message.
Actually data loader is loading wrong dates into SFDC Org.
please observe this,

CASE:1 (Correctly Loaded)
Actuall datetime value : = 12/7/11 11:36 PM (MM/DD/YY)
converted datetime value with time zone := 2011-12-07T23:36:44.44Z (yyyy-mm-ddThh:mm:ss.sssZ)
 Result in SFDC: = 7/12/2011 7:36 PM (Correctly loaded DD/MM/YYYY)

where as in 

CASE 2: (Wrongly loaded)
Actuall datetime value : = 4/13/12 9:32 AM (MM/DD/YY)
converted datetime value with time zone := 2012-04-13T09:32:01.01Z (yyyy-mm-ddThh:mm:ss.sssZ)
 Result in SFDC: = 1/4/1913 4:32 AM (Wrongly loaded DD/MM/YYYY)

I found that,
1. The MONTH with single DIGIT are loaded Wrongly. (CASE: 2)
2. The MONTH with double DIGIT are loaded Correctly (CASE: 1).

Timezone is (GMT-04:00) Eastern Daylight Time (America/New_York).
Please provide solution on this.
Thank you

 
//First error: SQLException [common.exception.SfdcSqlException: ORA-01013: user requested cancel of current operation
//select /*ApexBatch.Class.DeleteFlatRecords.start: line 13*/ *
from (select "Id"
from (select t.deleted "IsDeleted_gen_1",
t.custom_ent...
global class DeleteFlatRecords implements Database.Batchable<sObject>
{
     
     
     
     // Start Method
     global Database.QueryLocator start(Database.BatchableContext BC)
     {
     String   Query='select id from flat__C ';
         return Database.getQueryLocator(query);
 
     }

    // Execute Logic
    global void execute(Database.BatchableContext BC, List<sObject>scope)
    {
       
        List<Flat__c> flatRecords=new List<Flat__C>();
        for(sObject s: scope)
        {
            flat__C f= (flat__C )s;
            flatRecords.add(f);
        }
        
        if(flatRecords.size()>0)
        delete flatRecords;      
   
    }
   
   
   
    global void finish(Database.BatchableContext BC)
    {
    
      FlatRecords b = new FlatRecords ();
      database.executebatch(b,500);
     // system.abortJob(sc.getTriggerId());
}}
I am trying to show the user a popup only when the record is created. For every subsequent edit and save, the popup shouldn't be displayed. I have created 2 VF pages and 2 controllers so far and now I need some guidance on how to display this popup(QADuplicateAlert) only when a record is newly created.

Since I am passing the Id of my current page/record into the controller, the popup is displaying every time I edit something and save the page. Instead, I want this popup to only appear when the record is created the first time.

Any help is much appreciated!

Main Popup Page https://gist.github.com/miragedeb/651dadd518cd19aef72c

Controller for the above https://gist.github.com/miragedeb/25f3054a7cc304f03ac8

Handling the condition on when to pop up the pagehttps://gist.github.com/miragedeb/d2a358420118df57ed74

Controller for the above https://gist.github.com/miragedeb/34aafd27de7360d946e3
Hi all,

I'm using pageBlockTable to display rows of an inner class in my controller. Now, I also want every row to have an option to be deleted. I found solutions online similar to http://sfdcsrini.blogspot.com/2014/12/adding-and-deleting-rows-dynamically-in.html . But I would like to avoid using apex:variable because I think it's not that straightforward. So I tried to use a Map instead of a List of Row objects where the keys are the rowId of the Row objects. 

Here's my controller code:
public class TestInputController {
    
    public Map<Integer, Row> rows { get; set; }
    
    public TestInputController() {
        rows = new Map<Integer, Row>();
    }
    
    public void addRow() {
        Integer rowId = rows.size();
        rows.put(rowId , new Row(rowId));
    }
    
    public void removeRow() {
        rows.remove(Integer.valueOf(ApexPages.currentPage().getParameters().get('rowIdToRemove')));
    }
    
    public class Row {
        public Integer rowId { get; set; }
        public Row(Integer rowId) {
            this.rowId = rowId;
        }
    }

}

And here's my visualforce code:
<apex:page controller="TestInputController" docType="html-5.0">
    <apex:form >        
        <apex:pageBlock >
            <apex:pageBlockSection >
                <apex:pageBlockTable value="{!rows}" var="rid" id="tablet">
                    <apex:column headerValue="ID">
                        <apex:input type="number" value="{!rows[rid].rowId}" />
                    </apex:column>
                    <apex:column headerValue="Action">
                        <apex:commandButton action="{!removeRow}" value="x" rerender="tablet">
                            <apex:param value="{!rows[rid].rowId}" name="rowIdToRemove" />
                        </apex:commandButton>
                    </apex:column>
                </apex:pageBlockTable>
                <apex:pageBlockSectionItem >
                    <apex:commandButton value="Add Row" action="{!addRow}" rerender="tablet"/>
                </apex:pageBlockSectionItem>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

Unfortunately, when I try to save the VisualForce page, I get the error:
Error: Expected input type 'text', got 'number' for Id data type

I figured that this is the line that caused the error:
<apex:input type="number" value="{!rows[rid].rowId}" />

I know that I can go back to the solution I found online regarding deleting rows, but I just don't get it why I'm getting this error. When I was using Lists before, the line
<apex:input type="number" value="{!row.rowId}" />
works (where row is the var name i used in the pageBlockTable). Am I missing something here? Or is this a bug?

Thanks,
Mishael
Hi,

I'm woking on a requirment, where I need to have a link in Email template, on clicking the link, if the user is not looged into salesforce, then once he logs into salesforce, the user needs to be taken directly to page which the link is refering

I'm using a visualforce email template and my link is something like below.

<p>For email settings in community please click <a target="_blank" href="{!$Setup.MyPersonalSettings__c.Community_Base_URL__c}/VFPage">here</a></p>

currently if a user is already logged into salesforce/our commuinty then on clicking the link in email then the user is langing on the intended VF page, but this is not working if the user is logging into salesforce/commuinty on clicking the link.

Please help me with possible solution on this. Thank You
So, I already have a VisualForce page up, now, the thing is, i need to add an APEX class extension but unfortunately, for my account, the "Apex Classes" option under the develop menu is disabled. So how do i get this class to be attached to my webpage.


public class CoreValuesEXt
{
    ApexPages.StandardController sc;
    public boolean readonly {get; set;}
    public Core_Values__c cv {get; set;}
    public integer countEdit = 1;
    public string buttonValue {get; set;}
    public integer recordScan;
    public CoreValuesExt(ApexPages.StandardController sc)
    {
        this.sc = sc;
        cv = new Core_Values__c();
        cv.Account__c = sc.getid();
        
        readonly = true;
        buttonValue = 'Edit';
        recordScan = [SELECT COUNT() FROM Core_Values__c WHERE Account__c = :cv.Account__c];
       if (recordScan != 0){
       cv = [SELECT id, HSE__c, Professionalism_Integrity__c, Quality_Accuracy__c, Technology_Innovation__c, Timeliness__c, Value_for_money__c FROM Core_Values__c WHERE Account__c = :cv.Account__c];
        }
        
    }
    public ApexPages.PageReference Save()
    {
        return sc.Save();
    }
    
    public void ApplyAction()
    {
        countEdit++;
        Integer modolus = Math.mod(countEdit, 2);
        String total = cv.HSE__c + cv.Professionalism_Integrity__c + cv.Quality_Accuracy__c + cv.Technology_Innovation__c + cv.Value_for_Money__c + cv.Timeliness__c;
        if(modolus == 0)
        {
            readonly = false;
            buttonValue = 'Save';
        }
        else
        {
            if(total != 'nullnullnullnullnullnull')
               {
            if (recordScan == 0){
            insert cv;
            readonly = true;
            buttonValue = 'Edit';
            }
            else
            {
            update cv;
            readonly = true;
            buttonValue = 'Edit';
            }
            }
        }  
        
    }
}
 
Hi I have a requirement where I have to update a field in Custom Object when I click on a Custom Button(it's an HTML Component) in my Visualforce Email Template. I have added a Component and Controller in the Email Template but I am not able to track the action as form tag is Command Button is not supported. Can anyone faced this issue earlier.

Please help!!
Hi All,

I have made updates to a visualforce page and preview looks great.  I have changed a field from radio button option to drop down list.  I have updated the picklistManager and controller with dependencies.  somehow I don't see the changes in webpage.  all tests also passed.  Please help. 
trigger OrderInclusiveorWaive on OrderItem (before insert,before update) 
{
    List<Product2> pt = new List<Product2>();
      
    for(OrderItem op : Trigger.new)
    {
        for(PricebookEntry pbe : [Select Id, pricebook2id, product2id, unitprice From PricebookEntry Where Id=:op.PricebookEntryId])
        {
            for(Pricebook2 pb2 : [Select Id From Pricebook2 Where Id=:pbe.Pricebook2Id])
            {
                for(Product2 p : [Select Name From Product2 Where Id =: pbe.product2id])
                {
                       if(p.id == pbe.product2id)
                    {
                        if( op.Inclusive_or_Waive__c ==  TRUE )
                        {
                            if((op.Total_Hardware_Type_Ordered_Products__c) >= (op.Total_Package_Ordered_Products__c))
                              {
                                op.addError(' No Quantity is Matched,Please match it');
                            }
                        }
                        else if( op.Inclusive_or_Waive__c ==  FALSE )
                        {
                            if(p.id!=null || (op.Total_Hardware_Type_Ordered_Products__c) >= (op.Total_Package_Ordered_Products__c))
                            {
                                pt.add(p);
                            }
                        }
                    }
                    update p;
                }
            }
        }       
    }
}
HI All,
         I am Begginer of salesforce,I have  Create one Master field to One object(xxx) to another Object(yyyy).Now I dont want master Detail filed. So,How To Delete that master Field.??

Advance Thanks
Hey there, I was hoping to get a hand on how to implement javascript remoting. I have been told that it can be used to get passed the 135 kb view state limit and the 1000 row pageblocktable limit. I have a visualforce page which I have overriden my custom object tab (transactions). 

I wanted to test to see if it could handle bulk records as I am yet to release my system, on a side note i also employ Avi's pageblocktable enhancer. On first test after bulk uploading 2000 records i tried opening the tab and it only displayed 20 records, I played around wrote a custom controller (then added to it for all my overriden tabs, added read - only to the tab apex page tag, but I am still having trouble with view state.

Please, i was hoping someone could help me out by guiding me to imeplement javascript remoting, I am very lost in this and have only recently become semi decent in understand apex. Any tips on my code would also be appreciated. Thank you in advance for your help.

Page
<apex:page Controller="GlobalObject_Query"  tabStyle="Transaction__c" readOnly="true">
<apex:stylesheet value="https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/ui-lightness/jquery-ui.css"/>
<script>
$j = jQuery.noConflict();
function highlightElem(elem){
$j(elem).parent().parent().parent().find('tr').removeClass('ui-state-highlight');
$j(elem).parent().parent().addClass('ui-state-highlight');
}
</script>
<c:PageBlockTableEnhancerADV targetPbTableIds="pbtTra"  pageSizeOptions="25,50,100,250,500,750" defaultPageSize="25" enableExport="False"/>
<apex:sectionheader title="Transactions" subtitle="Home"></apex:sectionheader>
 <apex:form >
  <apex:pageBlock id="pb" >
 
    <apex:pageBlockTable value="{!GlobalTransactions}" var="Tra" cellPadding="4"  border="4" id="pbtTra">
<apex:column headerValue="Transaction"  >
<apex:commandLink rerender="Tradetails" oncomplete="highlightElem(this);"> {!Tra.Name}
<apex:param name="Tid" value="{!Tra.id}"/>
</apex:commandLink>
</apex:column>
<!-- <apex:column headervalue="Account" value="{!Tra.Account__c}"/> -->
<apex:column headervalue="Date" value="{!Tra.Date_of_Payment__c}"/>
<apex:column headervalue="Amount" value="{!Tra.Amount__c}"/>
<apex:column value="{!Tra.Method__c}"/>
<!-- <apex:column headervalue="Service" value="{!Tra.Service_Name__c}"/>-->
<apex:column headervalue="Office" value="{!Tra.Office__c}"/>

    </apex:pageBlockTable>

</apex:pageBlock>
 </apex:form>
<apex:outputPanel id="Tradetails">
<apex:detail subject="{!$CurrentPage.parameters.Tid}" relatedList="True" inlineEdit="True" title="false"/>
</apex:outputPanel>
</apex:page>


class
 
public class GlobalObject_Query{


 //Introduce Objects   
 public Transaction__c       Tra    {get;set;}
 public Service__c           Ser    {get;set;}
 public Finance__c           Fin    {get;set;}
 public Property__c          Prop   {get;set;}
 public Destiny_Survey__c    Sur    {get;set;}  
 public Office_Commission__c OffCom {get;set;} 
 public Office_Invoice__c    OffInv {get;set;}
 
 //Introduce Lists
 List<Transaction__c> TransList = new List<Transaction__c>();
 List<Service__c> ServList = new List<Service__c>();
 List<Finance__c> FinList = new List<Finance__c>();
 List<Property__c> PropList = new List<Property__c>();
 List<Destiny_Survey__c > SurvList = new List<Destiny_Survey__c >();
 List<Office_Commission__c> OffComList = new List<Office_Commission__c>();
 List<Office_Invoice__c> OffInvList = new List<Office_Invoice__c>();

   
   
   //Construct Controller and set variables     
   public GlobalObject_Query() {
   //Transaction
   this.Tra = Tra;
   this.transList = new List<Transaction__c>();
   //Service
   this.Ser = Ser;
   this.ServList = new List<Service__c>();
   //Finance
   this.Fin = Fin;
   this.FinList = new List<Finance__c>();
   //Properties
   this.Prop = Prop;
   this.PropList = new List<Property__c>();
    //Surveys
   this.Sur = Sur;
   this.SurvList = new List<Destiny_Survey__c >();
   //Office Commission
   this.OffCom = OffCom;
   this.OffComList = new List<Office_Commission__c>();
   //Office Invoice
   this.OffInv = OffInv;
   this.OffInvList = new List<Office_Invoice__c>();
    }      

   //Transaction Queries              
   public List<Transaction__c> getGlobalTransactions()
    {
    
        this.transList.addAll( [SELECT ID, Name, Amount__c, Account__c, Service_Name__c, method__c, Transaction_type__c, date_of_payment__c, Office__c, createddate FROM Transaction__c LIMIT 10000]);
    
 if (this.transList == null || this.transList.isEmpty()) {
            return null;
        }

        return this.transList;
    }
    
    
   //Service Queries              
   public List<Service__c> getGlobalServices()
    {
    
        this.ServList.addAll( [SELECT ID, Name, Account__c, Service_Name__c, Service_Type__c, Start_of_Service__c, Service_Stage__c, Amount_remaining__c, Office__c FROM Service__c LIMIT 10000]);
    
 if (this.ServList == null || this.ServList.isEmpty()) {
            return null;
        }

        return this.ServList;
    }
    
       //Finance Queries              
   public List<Finance__c> getGlobalFinances()
    {
    
        this.FinList.addAll( [SELECT ID, Name, Account__c, Finance_Office__c, Finance_Writer__c, Application_Submitted__c , Application_Amount__c, Conditional_Approval__c, Unconditional_Approval__c, Amount_Approved__c, Finance_Settlement__c FROM Finance__c LIMIT 10000]);
    
 if (this.FinList == null || this.FinList.isEmpty()) {
            return null;
        }

        return this.FinList;
    }
 
 
    //Property Queries              
   public List<Property__c> getGlobalProperties()
    {
    
        this.PropList.addAll( [SELECT ID, Account__c, Name, Office__c, Property_Type__c, Property_Full_Address__c, Destiny_Finance__c FROM Property__c LIMIT 10000]);
    
 if (this.PropList == null || this.PropList.isEmpty()) {
            return null;
        }

        return this.PropList;
    }
 
 
    //Survey Queries              
   public List<Destiny_survey__c> getGlobalSurveys()
    {
    
        this.SurvList.addAll( [SELECT ID, Name, Account__c, Office__c, Survey_Type__c, How_likely_are_you_to_refer_Destiny__c FROM Destiny_survey__c LIMIT 10000]);

    
 if (this.SurvList == null || this.SurvList.isEmpty()) {
            return null;
        }

        return this.SurvList;
    }
 
 
    //Office Commission Queries              
   public List<Office_commission__c> getGlobalOfficeCommissions()
    {
    
        this.OffComList.addAll( [SELECT ID, Name, Office__c, Commission_Period_Start__c, Commission_Period_End__c, Total_Professional_Service_Fees_Due__c, Total_Finance_Commissions_Due__c FROM Office_Commission__c LIMIT 10000]);
    
 if (this.OffComList == null || this.OffComList.isEmpty()) {
            return null;
        }

        return this.OffComList;
    }
 
 
    //Office Invoice Queries              
   public List<Office_Invoice__c> getGlobalOfficeInvoices()
    {
    
        this.OffInvList.addAll( [SELECT ID, Name, Office_Invoice_Date__c, Office_Invoice_Amount__c, Office_Invoice_Description__c, Payment_Date__c, Office_Name__c, Office_Commission__c FROM Office_Invoice__c LIMIT 10000]);

 if (this.OffInvList == null || this.OffInvList.isEmpty()) {
            return null;
        }

        return this.OffInvList;
    }
 
 
}