You need to sign in to do that
Don't have an account?
Not possible to get dynamic field describe information from a visualforce page?
I am working on a visualforce component that displays fields of arbitrary sobject.
Now I need a way to get some field describe information for a given sobject name and field name.
As I cannot pass Describe objects to the page I would have to create my own schema class to pass this Not nice!
The I read one could use the $ObjectType global variable in pages and that this works with dynamic binding. But it seems only to work with fields not objects...
WORKS: {!$ObjectType.Account.Fields[fieldName].Label
DOES NOT WORK: {!$ObjectType[objectName}.Fields[fieldName].Label
Why and in case this does not work what else should I do to get those information without an extra custom class?
Thanks in advance
Robert
I assume you meant {!$ObjectType[objectName].Fields[fieldName].Label} not what you have in your post.
I think there are currently some bugs related to this; it should be working in the next (Spring 12) release.
Oh yes you are right, I had a typo. But anyway I does not work. where can I find infos on those bugs and is there a workaround until the realease of Spring 12?
Robert
Any news with this? I was trying to do something similar. I posted about it here: http://forums.sforce.com/t5/Java-Development/Javascript-GETRECORDIDS-on-Contract-to-Return-Account-Ids/td-p/439347
I'd ove to be able to get the field's id so I could dynamically code the urls in the question...
http://boards.developerforce.com/t5/General-Development/Overiding-a-standard-button-using-visualforce-with-a-simple/td-p/178280