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 

Internal Server Error

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; } }

 

 

 

David VPDavid VP

How are you using this in CMSForce ? I don't see any <c:contentblock .../> custom components in your VF code.

What is the 'kid' parameter : are you using CMSForce's Web Forms (in which case you'd need the API name of the field you're prefilling : kid__c) ? Or are you mixing this VF code in a pagetemplate ?