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
Justin Bernard Rafael CosioJustin Bernard Rafael Cosio 

Content cannot be displayed: Id value 00128000002k7Df is not valid for the Core_Values__c standard controller

I have an issue here. I was able to add all the necessary radio buttons on the VisualForce page for a Core Values  object. When I go to the page, it shows: Content cannot be displayed: Id value 00128000002k7Df is not valid for the Core_Values__c standard controller.

Here's the code.

<apex:page standardController="Core_Values__c">
<style type="text/css">
input[type="radio"]:checked {
    background-image: url("http://throwingthebowlines.com/wp-content/uploads/2013/12/checkbox.png");
}
        input[type="radio"]:checked+label{ color:red; font-weight:bold; }
    </style>

      <apex:form >
      <apex:pageBlock >
      <apex:pageblocksection columns="1" title="Core Values">
      <apex:selectRadio label="HSE" value="{!Core_Values__c.HSE__c}" border="1">
      <apex:selectOption itemLabel="Excellent" itemValue="6"/>
      <apex:selectOption itemLabel="Very Good" itemValue="5"/>
      <apex:selectOption itemLabel="Good" itemValue="4"/>
      <apex:selectOption itemLabel="Average" itemValue="3"/>
      <apex:selectOption itemLabel="Fair" itemValue="2"/>
      <apex:selectOption itemLabel="Poor" itemValue="1"/>
      </apex:selectRadio>
      
      <apex:selectRadio label="Professionalism & Integrity" value="{!Core_Values__c.Professionalism_Integrity__c}" border="1">
      <apex:selectOption itemLabel="Excellent" itemValue="6"/>
      <apex:selectOption itemLabel="Very Good" itemValue="5"/>
      <apex:selectOption itemLabel="Good" itemValue="4"/>
      <apex:selectOption itemLabel="Average" itemValue="3"/>
      <apex:selectOption itemLabel="Fair" itemValue="2"/>
      <apex:selectOption itemLabel="Poor" itemValue="1"/>
      </apex:selectRadio>
      
      <apex:selectRadio label="Quality / Accuracy" value="{!Core_Values__c.Quality_Accuracy__c}" border="1">
      <apex:selectOption itemLabel="Excellent" itemValue="6"/>
      <apex:selectOption itemLabel="Very Good" itemValue="5"/>
      <apex:selectOption itemLabel="Good" itemValue="4"/>
      <apex:selectOption itemLabel="Average" itemValue="3"/>
      <apex:selectOption itemLabel="Fair" itemValue="2"/>
      <apex:selectOption itemLabel="Poor" itemValue="1"/>
      </apex:selectRadio>
      
      <apex:selectRadio label="Technology / Innovation" value="{!Core_Values__c.Technology_Innovation__c}" border="1">
      <apex:selectOption itemLabel="Excellent" itemValue="6"/>
      <apex:selectOption itemLabel="Very Good" itemValue="5"/>
      <apex:selectOption itemLabel="Good" itemValue="4"/>
      <apex:selectOption itemLabel="Average" itemValue="3"/>
      <apex:selectOption itemLabel="Fair" itemValue="2"/>
      <apex:selectOption itemLabel="Poor" itemValue="1"/>
      </apex:selectRadio>
      
      <apex:selectRadio label="Timeliness" value="{!Core_Values__c.Timeliness__c}" border="1">
      <apex:selectOption itemLabel="Excellent" itemValue="6"/>
      <apex:selectOption itemLabel="Very Good" itemValue="5"/>
      <apex:selectOption itemLabel="Good" itemValue="4"/>
      <apex:selectOption itemLabel="Average" itemValue="3"/>
      <apex:selectOption itemLabel="Fair" itemValue="2"/>
      <apex:selectOption itemLabel="Poor" itemValue="1"/>
      </apex:selectRadio>
      
      <apex:selectRadio label="Value for Money" value="{!Core_Values__c.Value_for_Money__c}" border="1">
      <apex:selectOption itemLabel="Excellent" itemValue="6"/>
      <apex:selectOption itemLabel="Very Good" itemValue="5"/>
      <apex:selectOption itemLabel="Good" itemValue="4"/>
      <apex:selectOption itemLabel="Average" itemValue="3"/>
      <apex:selectOption itemLabel="Fair" itemValue="2"/>
      <apex:selectOption itemLabel="Poor" itemValue="1"/>
      </apex:selectRadio>
      
      </apex:pageblocksection>
      </apex:pageBlock>
      </apex:form>     
</apex:page>
Best Answer chosen by Justin Bernard Rafael Cosio
Himanshu ParasharHimanshu Parashar
Hi Justin,

you have added standardController="Core_Values__c" it means it will point to Core_values__c object record but you are passing Account object record 00128000002k7Df in id parameter. Please pass a record id of Core_values__c object in id parameter.

wrong one
 
/apex/pagename?id=00128000002k7Df

correct one
 
/apex/pagename?id=CORE_VALUES_RECORD_ID


Thanks,
Himanshu
Salesforce Certified Developer | Administrator | Service Cloud Consultant

P.S.  If my answer helps you to solve your problem please mark it as best answer. It will help other to find best answer.

 

All Answers

Himanshu ParasharHimanshu Parashar
Hi Justin,

you have added standardController="Core_Values__c" it means it will point to Core_values__c object record but you are passing Account object record 00128000002k7Df in id parameter. Please pass a record id of Core_values__c object in id parameter.

wrong one
 
/apex/pagename?id=00128000002k7Df

correct one
 
/apex/pagename?id=CORE_VALUES_RECORD_ID


Thanks,
Himanshu
Salesforce Certified Developer | Administrator | Service Cloud Consultant

P.S.  If my answer helps you to solve your problem please mark it as best answer. It will help other to find best answer.

 
This was selected as the best answer
Justin Bernard Rafael CosioJustin Bernard Rafael Cosio
I went to the page and it goes fine. However, when I go to the layout on where that page was placed, that error still appears
Justin Bernard Rafael CosioJustin Bernard Rafael Cosio
not to mention my account has no access to apex classes