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
MRosiMRosi 

Picklist from in custom object's standard controller

Hello,

 

Some questions about dependent picklists and rolling my own from another object. I've already successfully built my own picklists in apex and used them in VF pages, this is a little more involved. 

 

I have an Item__c which has a type, subtype and subsubtype. They would be dependent picklists, but I need to be able to allow my client to update this hierarchy of product types, so I have made a separate object to hold them, Item_Type__c and plan to roll my own picklists from apex to show in a VF page.

 

This will also let me access the hierarchy information from other objects and easily select a set of values for custom reports, etc. I don't see much information on how to explore the dependency matrix used in dependent picklists.

 

My questions:

1. What is the standard way to build dependent picklists from apex, or is this still not possible? Is the Javascript remoting from Summer 2011 the way to do it? I'm targeting IE, Chrome and also Windows Mobile 6.5 Professional's IE where I don't know how well it would work...

2. Is there a standard way to ask an object's picklist what is the controlling value? For example, if I have a SubSubType "Pellets" dependent on SubType "Plastic", given "Pellets" what query will give me "Plastic"?

3. Is there a way to override Item__c 's standard detail page so that these custom picklists will show up inside them, without making an entire VF page to completely replace the object edit page? It seems possible to add VF pages or Components into a page layout but I have not been able to find the relevant documentation yet. This would have to also be a set of dependent picklists that would operate the same way as normal dependent picklists would, despite that the values are coming from a SOQL query on a separate object's records.

4. Summer 2010 introduced picklists in VF with code like <apex:inputField  Can I in fact show in VF dependent picklists from Item_Type__c within a VF page (controller extension based on an Item__c or maybe a different object, Transaction__c). 

 

Thanks for your help!

 

Matt