In my controller, I have some SObjectType
property:
public SObjectType myProperty { get; private set; }
I want to get the label (or better yet the entire describe) of this object in Visualforce without modifying my Apex to add any additional properties. Is it possible?
In my current use case, this property is surfaced as part of a larger feature and can't be easily modified or extended.
Attempt 1:
{!myProperty.describe.label}
Error 1:
Unknown property 'SObjectTypeToken.describe'
Attempt 2:
{!$ObjectType[myProperty].label}
Error 2:
Incorrect parameter type for subscript. Expected Text, received SObjectType
Attempt 3:
{!TEXT(myProperty)}
Error 3:
Incorrect parameter type for function 'TEXT()'. Expected DateTime, received SObjectType
Attempt 4:
{!myProperty.label}
Error 4:
Unknown property 'SObjectTypeToken.label'