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
UbaldoUbaldo 

Problems with Describe in the Spring 12 update

My ORG was just upgraded to Spring 12 about 1 hour ago.

 

I'm getting weird errors from lots of pages like this:

 

Unknown property 'String.labelplural'

 

And null pointer exceptions.

 

Things like:

 

{!$ObjectType['User'].label}

or

{!$ObjectType['User']['label']}

 

Doesn't work anymore.

 

Anyone else experimenting same issues? Any advices?

 

Ankit AroraAnkit Arora

Can you please explain more as this code is working fine for me on version 22.0 and 23.0

 

<apex:page>
    {!$ObjectType.Account.Fields.Name.Label}
    <br/>
    {!$ObjectType['User'].label}
    <br/>
    {!$ObjectType['User']['label']}
</apex:page>

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

UbaldoUbaldo

That is working for me too, but if I remove the first statement as follows:

<apex:page>
    <br/>
    {!$ObjectType['User'].label}
    <br/>
    {!$ObjectType['User']['label']}
</apex:page>

 It gives me an error. BTW, I'm trying this is a recently Spring 12 upgraded sandbox.

MikeS1MikeS1

The example from our code which is failing...

 

The error...

 

Unknown property 'String.labelplural'

Error is in expression '{!describe.labelplural}' in component <apex:variable> in component c:breadcrumbviewobject

The page...

 

<apex:page showHeader="false" standardStylesheets="true" controller="ConfigurationItemControllerExtension" action="{!testObject}">
  <apex:outputText escape="false"  rendered="{!NOT(ISBLANK(FullConfigurationItemSObject))}">
  <apex:composition template="ITinvolveSiteTemplate">

    <apex:define name="breadcrumb">
      <c:BreadcrumbViewObject subjectObject="{!FullConfigurationItemSObject}"
        describe="{!$ObjectType[objectTypeName]}" <!-- THE objectTypeName value is defined and correct -->
        listUrl="{!listUrl}" />
    </apex:define>

....

 

The BreadCrumbViewObject component...

<apex:component >
  <apex:attribute name="subjectObject" type="SObject" description="The Object" required="true" />
  <apex:attribute name="describe" type="DescribeSObjectResult" description="The DescribeSObjectResult of the Object" required="true" />
  
  <apex:attribute name="listUrl" type="String" description="The URL of the list of this object" required="true" />
  
  <apex:variable var="trailNames" value="" />
  <apex:variable var="trailUrls" value="" />
  
  <apex:variable var="labelPlural" value="{!describe.labelplural}" /> <!-- FAILS HERE -->
  <apex:variable var="labelNew" value="New {!describe.label}" />
  <apex:variable var="objectTypeName" value="{!describe.Name}" />

....

 

This works on Winter'12 and fails on Spring'12