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
Tate PriceTate Price 

How do I use Visualforce to create custom picklist values?

How do I use Visualforce to create custom picklist values?I am brand new to Visualforce and Apex and I need a way to find values for a specific parent object which fit a certain criteria. 

I am creating a reservation system for a remote office CRM in which users will login, look at one of two offices and find available desks. I also want the User to see which Users have reserved which desks. I know this is not possible given the picklist functionality inside of Salesforce but I am curious if it is possible using a custom VF page. 

I have three objects - Users(standard), Desk Assignments(custom) and Offices(custom). Offices have all of the physical info for the office. Desk assignments have all of the information about the reservation (Dates, Desk numbers, etc). 

1st question: should I nest the Desk numbers field within the Offices object, the Desk Reservations object or create a third custom object called Desks?

2nd question: How do I go about creating a custom Visualforce page that when a User selects an office, they see only the Available desks for the dates they wish to reserve the desk? 

I imagine the functioality to look a lot like an airplane seat reservation system in which the User can see who has reserved which desk (which I need to incorporate) and then select the desk for the specified period.

As mentioned, I am brand new to VF and Apex as my background is in Ruby. 

Thanks for any and all assistance. 
Shashikant SharmaShashikant Sharma
You could use apex:selectList for custom picklist. See example : http://www.sfdcpoint.com/salesforce/custom-picklist-in-visualforce-salesforce/