I want to understand this error as I have never seen this before.
Content cannot be displayed: Invalid conversion from runtime type L1dlF0rm0rg__Case__c to ICIX_V1__ICIX_Product__c
Background: I am trying to use a visualforce page & extension to view records associated through a lookup (not the related list records, the "parent") I am trying to invoke the standard controller for my case__c
object in my extension. So, I can put this visual force page in the detail of the case__c
object. (record details) currently just bringing the name is so I can see if it works. I will bring in other specific fields later on.
But, I wanted to understand the error that I am getting so I can better troubleshoot this. I have researched this, but I do not see much information that describes the error to be.
code:
Extension:
public with sharing class CaseParentExt {
public ICIX_V1__ICIX_Product__c prods{ get; set; }
public ApexPages.StandardController stdController;
public CaseParentExt(ApexPages.StandardController stdController) {
this.prods = (ICIX_V1__ICIX_Product__c)stdController.getRecord();
this.stdController = stdController;
}
public void CaseParentExt() {
String prodsId = ApexPages.currentPage().getParameters().get('id');
prods = [SELECT Id, Name FROM ICIX_V1__ICIX_Product__c WHERE Id =: prodsId];
}
}
VFP:
<apex:page standardController="L1dlF0rm0rg__Case__c" extensions="CaseParentExt">
<apex:form >
<apex:pageblock title="Related Products">
<apex:pageMessages />
<apex:pageBlockSection >
<apex:pageBlockSectionItem >
<apex:outputLabel >Product Name</apex:outputLabel>
<apex:outputText >{!prods.Name}</apex:outputText>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:pageblock>
</apex:form>
</apex:page>