One thing that comes up a lot in the in the #salesforce IRC channel is doing dynamic Visual Force driven off of picklists. So, let’s buckle up and get to it.
Data Model
In this simple example we are going to make an extension to the case page. On this page we are going to us a custom Product/Version object to display on the page. The product list well be determined on the start/end date of the product. And the version will be driven by the currently selected product. Product
- Name – The name of the product
- Currently_Supported__c – Formula based on StartDate__c and EndDate__c (Integer version of a boolean)
- StartDate__c – The date the product should be shown (Rollup min from the version)
- EndDate__c – The date the product should be hidden (Rollup max from the version)
Version
- Name – The name of the version
- Currently_Supported__c – Formula based on StartDate__c and EndDate__c (Integer version of a boolean)
- StartDate__c – The date the version should be shown
- EndDate__c – The date the version should be hidden
- Product__c – The product the version is related to