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
arshadrarshadr 

Custom VF Page not working with CMSForce

I have a custom visualforce page which takes the lead id as parameter and populates lead record fields for update.

Everything works fine when i access my page with /apex/pagename?id=AAAAA but when i access this page with CMSForce by creating Template and then creating PageItems etc., my page through this exception

 


SObject row was retrieved via SOQL without querying the requested field: Lead.Courier__c

 

any idea abt this exception ? thanks ..

 

Arshad

 

 

 

Ajay111Ajay111

currect your soql query

 

write Courier__c after select in query

 

 

arshadrarshadr

Ajay, thanks for the reposne. I think SOQL is not a problem here. I am using standard controller functionality to populate the fields here. Please have a look at my code below

 

<apex:page standardController="Lead" showHeader="false" extensions="LeadExtension2" >

<apex:form>

.

.

<apex:inputField value="{!Lead.Courier__c}" required="true"/>

.

.

</apex:form>

</apex:page>

 

 

LeadExtension2 controller

 

constructor..

 

public LeadExtension2(ApexPages.StandardController controller) {

        this.l = (Lead)GstdController.getRecord(); }

 

I tried using this code <apex:inputField value="{!l.Courier__c}" required="true"/>

but still i am getting the same error SObject row was retrieved via SOQL without querying the requested field: Lead.Courier__c

 

This page works fine without CMSForce involvement.

 

 



        

 

Ajay111Ajay111

public Lead l{get; set;}
public LeadExtension2(ApexPages.StandardController stdController)
{
l= (Lead)stdController.getRecord();
}

 

Use this code