• Saaku
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
Hi folks!
My requirement
my apec class is
public class fetch {
   public String accountname{set;get;}
    public string destquery{set;get;}
    public List<customer__c> cust{set;get;}
    public fetch(){
       string accountname;
        cust=new List<customer__c>();
    }
    public void show(){   
        destquery='select Balance__c,City__c,State__c from Customer__c where name=\'' +accountname+'\'';       
    }
}

My vf page is
<apex:page controller="fetch">
    <apex:form >
    <apex:pageBlock >
        <apex:outputLabel value="Name" /><apex:inputText >{!accountname}</apex:inputText>
        <apex:commandButton value="Ok" action="{!show}"/>
    </apex:pageBlock>
        <apex:pageBlock >
      <!--    <apex:pageBlockTable value="{!destquery}" var="a">
               <apex:column value="{!a.Balance__c}" /> 
                 <apex:column value="{!a.City__c}" />
                 <apex:column value="{!a.State__c}" />          
            </apex:pageBlockTable> -->
           {!accountname}
        </apex:pageBlock>
    </apex:form>
</apex:page>

butI'm not getting the fetching records pls help where I done wrong.

Thanks in Advance
  • March 18, 2015
  • Like
  • 0
Hi folks!
My requirement
my apec class is
public class fetch {
   public String accountname{set;get;}
    public string destquery{set;get;}
    public List<customer__c> cust{set;get;}
    public fetch(){
       string accountname;
        cust=new List<customer__c>();
    }
    public void show(){   
        destquery='select Balance__c,City__c,State__c from Customer__c where name=\'' +accountname+'\'';       
    }
}

My vf page is
<apex:page controller="fetch">
    <apex:form >
    <apex:pageBlock >
        <apex:outputLabel value="Name" /><apex:inputText >{!accountname}</apex:inputText>
        <apex:commandButton value="Ok" action="{!show}"/>
    </apex:pageBlock>
        <apex:pageBlock >
      <!--    <apex:pageBlockTable value="{!destquery}" var="a">
               <apex:column value="{!a.Balance__c}" /> 
                 <apex:column value="{!a.City__c}" />
                 <apex:column value="{!a.State__c}" />          
            </apex:pageBlockTable> -->
           {!accountname}
        </apex:pageBlock>
    </apex:form>
</apex:page>

butI'm not getting the fetching records pls help where I done wrong.

Thanks in Advance
  • March 18, 2015
  • Like
  • 0