function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Vidhyasagaran MuralidharanVidhyasagaran Muralidharan 

Requirement on VF and apex

I have a requirement like there are five objects in my app. and each object has set of records.And there is VF page in that i have one picklist .
which contains all these five object names.If i select a object name it should dynamically populate records and column name for the particular object in to that visulaforce page.

Guys help me in this.
RishavRishav
Hiii  Vidhyasagaran,
 I am giving you the idea  of how to implement this requiremet not code so try my concept and see it happen or not:

1. create one controller
2. create one picklist  using apex and assign the 5 states value in it 
3. Declare 5 variable for 5 objects of list type for storing the result
4.now in coding section write an if condition and checkout the state name like this
   if(state=='Tamilnadu')
{
  your variable name(list<object of which you want to store the result>tl = [select name,city,id,................. from  desires object name)
}
else if(state=='AP)
{
  list<object of which you want to store the result>  obj2 = [query]
}

try in this way you will get result.

Thanks
Rishav