You need to sign in to do that
Don't have an account?

Display Records by selected date range and selected object from picklist
Hi,
I have a visualforce page where i have a from date and to date field and a picklist which has all objects. There is a command button.
We have to select from date and to date and select a object from picklist and when pressed, it will display all the records in that object.
Need Help
----
<apex:page controller="objectLists">
<apex:form >
From Date :<input type="date" name="frmday" id="fday"/>
To Date :<input type="date" name="today" id ="tday"/>
<apex:SelectList value="{!val}" size="1">
<apex:selectOptions value="{!Name}" id="list"></apex:selectOptions>
</apex:SelectList>
<apex:commandButton value="Display" action="{!display}"/>
</apex:form>
<apex:pageBlock ></apex:pageBlock>
</apex:page>
---controller --
public class objectLists{
String searchText;
List<Lead> results;
public String val {get;set;}
public String objName { get; set; }
List<Account> lstaccount = new List<Account>();
public List<SelectOption> getName()
{
List<Schema.SObjectType> gd = Schema.getGlobalDescribe().Values();
List<SelectOption> options = new List<SelectOption>();
for(Schema.SObjectType f : gd)
{
options.add(new SelectOption(f.getDescribe().getLabel(),f.getDescribe().getLabel()));
}
return options;
}
Hi,
Could you please modify my controller with the dynamic query to achieve the requirement.
Regards