• arshadr
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies

I have developed a VF page and an extension to Lead object. When i use this page with CMSForce i got Internal Server Error after submitting the form. without CMSForce its was working fine.

 

After some experiments, i noticed that this error occurs when i use multiple querystring parameters like

https://c.ap1.visual.force.com/apex/page?pageid=a0B90000000TRBd&kid=00Q90000001GwdP

 

I tried to hard code "kid" value in my controller code and remove it from the parameter, it works fine then.

 

Please have a look atmy code below.

 

Thanks,

Arshad   

 

VF Page

 

 

<apex:page standardController="Lead" showHeader="false" extensions="testclass"> <apex:form> Name: <apex:inputText value="{!FirstName}"></apex:inputText> <apex:commandButton status="updateStatus" value="Update Lead" action="{!updateLead}" reRender="Result1"/> </apex:form> <apex:outputPanel id="Result1"> <apex:actionStatus id="updateStatus" startText="Requesting... "> <apex:facet name="start"> Updating... Please wait .. </apex:facet> <apex:facet name="stop"> <apex:pageMessages ></apex:pageMessages> </apex:facet> </apex:actionStatus> </apex:outputPanel> </apex:page>

 

Testclass controller

 

 

public class testclass { private String firstName; public String getFirstName() { return this.firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public testclass(ApexPages.StandardController controller) { try { String qp = ApexPages.currentPage().getParameters().get('kid'); Lead lead2; lead2 = [select Id,FirstName, LastName from Lead where id = :qp]; this.FirstName = lead2.FirstName; } catch(Exception ex) { ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'Updated Successfully'); ApexPages.addMessage(myMsg); } } public PageReference updateLead() { ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'Updated Successfully'); ApexPages.addMessage(myMsg); return null; } }

 

 

 

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

 

 

 

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