we will write no of type dynamic soql like using database.query(); and first you need to decleare one variable what you want pass public class dynamic { public string name{set;get;} (or) public date birthday{set;get;} public list<account> acc{set;get;} public void dynamic(){ acc=[select industry,phone from account where name=:sham ]; } } <apex:page controller ="dynamic"> <apex:form> <apex:inputtext value="{!name}"/> <apex:commandbutton value="view" action={!dynamic}> <apex:pageblock title ="display details"> <apex:pageblocktable valuu="{!accx}" var="a"> <apex:colunm value="{!a.industry}"/> <apex:colunm value="{!a.phone}"/> </apex:pageblocktabel> </apex:pageblock> </apex:form> </apex:page>
just try this man and tell me i hope this is help ful for u
Hi VSK,
It is possible, Please post your clear scenario here.
In SOQL query through bind variable we can pass dynamic values for query.
Below is one way..
String strName = 'yourName';
Thanks,
Jagadeesh.
I dont wanna use SOQL Query here...............want to do with dynamic Apex
Try this one,
Thanks,
Infu.
1) http://amitsalesforce.blogspot.in/search/label/Apex%20Describe Let us know if this will help you
Thanks
Amit Chaudhary
and first you need to decleare one variable what you want pass
public class dynamic {
public string name{set;get;}
(or)
public date birthday{set;get;}
public list<account> acc{set;get;}
public void dynamic(){
acc=[select industry,phone from account where name=:sham ];
}
}
<apex:page controller ="dynamic">
<apex:form>
<apex:inputtext value="{!name}"/>
<apex:commandbutton value="view" action={!dynamic}>
<apex:pageblock title ="display details">
<apex:pageblocktable valuu="{!accx}" var="a">
<apex:colunm value="{!a.industry}"/>
<apex:colunm value="{!a.phone}"/>
</apex:pageblocktabel>
</apex:pageblock>
</apex:form>
</apex:page>
just try this man and tell me i hope this is help ful for u
Thanks,
Srinivas
- Please mark as solution if your problem is resolved.