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
mmixmmix 

describeLayout? or alternative? big problem

Hi, I am porting a wizard from crappy looking s-controls to a set of apex pages and I have some problems.
I can't seem to find a way to call describeLayout() for an SObject (Case in this case). I actually need access to methods:

recordTypeMappings(field).picklistsForRecordType()

I need this so I can limit the two dependent picklists based on the current record type. The <apex:inputField> seems to completely ignore the record type and picklist dependency and just shows all picklist values and apex framework does not seem to have describeLayout() support (?!?!?)

The only thing I can get is a List<Schema.PicklistValue> from Case.mylist.getDescribe().getPicklistValues() but this is not limited in any way. And hardcoding is not an option because picklists should be expandable without having to resort to coding again.

I also cannot find a validFor property in Schema.PicklistValue that keeps a bitmap for dependencies between values of two dependent picklists.

How can I obtain these informations? This is a big problem.

Message Edited by mmix on 12-09-2008 03:01 AM
JeremyKraybillJeremyKraybill
VisualForce doesn't support dependent picklists "out of the box". There is a somewhat tolerable workaround in code, as covered in this thread.

Please vote to add support for this,  to me it should be considered a bug / gaping feature gap that it doesn't have this fundamental input type.


Message Edited by JeremyKraybill on 12-11-2008 12:28 PM
mmixmmix
Is there maybe a way to call SF's web services API from apex (I know it sounds crazy and unoptimized, but if its the only way to do it, sounds way better than using JS ajax code in visualforce page to call describelayout and then post the list to page just so it can be drawn back to the user), say hookup SF with its own web service API. I dont know if its possible at all, and am not exactly sure how to extract session and credential informations from current apex session and if its reusable in web service API (like it can be done client side)

I voted, but it appears they are not taking this into consideration for spring 09 so who knows when and if it will happen. I don't understand all this, what are we talking about here, SF developers' egos? Do they refuse to acknowledge they messed up here? Without covering 100% of s-controls/webservice functionality the apex/visual force is just a half-baked product spawned from a nice idea.

Message Edited by mmix on 12-12-2008 12:57 AM