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
pinoytechiepinoytechie 

common.apex.runtime.bytecode.BytecodeApexObjectType cannot be cast to common.apex.runtime.impl.ApexType on Salesforce Idea

Hi, we are tasked to expose Ideas in a community site via VF page. We are just starting and we are already hitting a brickwall.

We are getting this message when using contoller exention for Idea object:
common.apex.runtime.bytecode.BytecodeApexObjectType cannot be cast to common.apex.runtime.impl.ApexType

Steps to reproduce

For IdeaStandardController:
1) Create the extension controller class:
public class IdeaDetail_XT {
    public HROIdeaDetail_XT (ApexPages.IdeaStandardController controller) {}
}
2) Create the visualforce page. vf page. Let's call it IdeaDetail_VF:
<apex:page standardController="Idea">
    <!-- nothing here -->
</apex:page>
3) Steps #1 and #2 are both fine. Both are saved without problems.
4) Now, edit the IdeaDetail_VF, add the extentions attribute to the page... i.e.:
<apex:page standardController="Idea" extensions="IdeaDetail_XT">
    <!-- nothing here -->
</apex:page>
5) Try to save the IdeaDetail_VF and this error appears:
common.apex.runtime.bytecode.BytecodeApexObjectType cannot be cast to common.apex.runtime.impl.ApexType

For IdeaStandardSetController:
1) Create the extension controller class:
public class IdeaList_XT {
    public IdeaList_XT(ApexPages.IdeaStandardSetController controller) {
        //nothing here
    }    
}
2) Create the visualforce page. vf page. Let's call it IdeaList_VF:
<apex:page standardController="Idea">
    <!-- nothing here -->
</apex:page>
3) Steps #1 and #2 are both fine. Both are saved without problems.
4) Now, edit the IdeaList_VF, add the extentions attribute to the page... i.e.:
<apex:page standardController="Idea" extensions="IdeaList_XT">
    <!-- nothing here -->
</apex:page>
5) Try to save the IdeaList_VF and this error appears:
common.apex.runtime.bytecode.BytecodeApexObjectType cannot be cast to common.apex.runtime.impl.ApexType

NOTE: Tried in 3 different sandboxes, same result.

Thanks,
Aldrin
Pankaj_GanwaniPankaj_Ganwani
Hi Aldrin,

Why have you wrapped the extensions attribute of <apex:page> tag within <b> tag? Please remove it and then try to save vf page.
<apex:page standardController="Idea" extensions="IdeaDetail_XT">
    <!-- nothing here -->
</apex:page>

 
pinoytechiepinoytechie
I am not wrapping the extensions attribute with <b> tag. I think that's a bug in this forum. If you "Add a code sample" in this forum's editor, and you format a text within the sample to bold, it appears as bold while editing it. But when you saved it, it shows the <b> tag instead of it being bold. You can try it.

I was trying to put emphasis on the changes done. It was like this when I was editing it:
<apex:page standardController="Idea" extensions="IdeaList_XT">
        <!-- nothing here -->
</apex:page>