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
BritishBoyinDCBritishBoyinDC 

Apex composition tag and standard controller

So I'm pretty sure this worked last week, but now doesn't...did something change with the new release...

 

This simple VF page still works:

 

<apex:page standardController="Position__c" title="Job Details" showHeader="false" standardStylesheets="false"> <apex:form > <!-- The site template provides the site layout and style --> <!-- Breadcrumb link back to the search page --> <apex:outputLink value="<- Back to Search" onclick="top.history.go(-1);return false;" /> <br/> <!-- Job details --> <apex:pageBlock> <h3><apex:outputField value="{!Position__c.name}"/></h3><br/><br/> </apex:pageBlock> </apex:form> </apex:page>

 

 But when I add in the apex:composition tag below, it breaks with the following error:

SObject row was retrieved via SOQL without querying the requested field: Position__c.Name

 

But the tags work fine on every other page - just not when I use a standard controller?

 

 

<apex:page standardController="Position__c" title="Job Details" showHeader="false" standardStylesheets="false"> <apex:composition template="{!$Site.Template}"> <apex:define name="body"> <apex:form > <!-- The site template provides the site layout and style --> <!-- Breadcrumb link back to the search page --> <apex:outputLink value="<- Back to Search" onclick="top.history.go(-1);return false;" /> <br/> <!-- Job details --> <apex:pageBlock> <h3><apex:outputField value="{!Position__c.name}"/></h3><br/><br/> </apex:pageBlock> </apex:form> </apex:define> </apex:composition> </apex:page>

 

 

 

 

WesNolte__cWesNolte__c

Hey

 

Seems this guy has a similar issue. Although there's no sure-fire resolution there, there does seem to be a workaround and a bit more info.

 

Wes

BritishBoyinDCBritishBoyinDC
Thanks Wes - I will cross post there are see if anyone can shed some light on what changed...