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
uptime_andrewuptime_andrew 

VF Page - Can't Load Page w/o Id

I'm attempting to create a new VF page with the Quote object, but am seeing the following error when I load my page without an Id defined:

 

Invalid parameter value "" for parameter "id". 

 

 

My VF page is the first step of a wizard to create the quote, so obviously this is a problem.  If I load the page with a valid Quote Id, then the page loads fine.

 

Any thoughts on this?  Is there something specific to the Quote object that won't allow me to work with it in a similar manner to other objects?

 

 

Best Answer chosen by Admin (Salesforce Developers) 
CTU007CTU007

I think the issue is with this one:

 

 

<apex:inputField value="{!quote.Opportunity.Id}" id="oppId" required="true" />

 

 try change to

 

 

<apex:inputField value="{!quote.OpportunityId}" id="oppId" required="true" />

 

 

 

 

All Answers

kshannonkshannon
I think you're going to have to post code for this one.
uptime_andrewuptime_andrew

Here is some basic code - no extension used, just trying to create a new Quote.  If I try to load this page (/apex/quoteWizardTest), I get the error listed after the code.

 

Code:

 

<apex:page standardController="Quote" title="Quote Wizard"> <apex:form id="theForm"> <apex:pageBlock title="Quote Wizard - Step 1: Basic Information"> <apex:pageMessages /> <apex:pageBlockButtons > <apex:commandButton action="{!save}" value="Save" /> <apex:commandButton action="{!cancel}" value="Cancel" /> </apex:pageBlockButtons> <apex:pageBlockSection title="Essential Information" columns="2"> <apex:inputField value="{!quote.Name}" required="true" /> <apex:inputField value="{!quote.Opportunity.Id}" id="oppId" required="true" /> </apex:pageBlockSection> <apex:pageBlockSection title="Other Details" columns="1" > <apex:inputField value="{!quote.Quote_Date__c}" style="width: 300px" /> <apex:inputField value="{!quote.ExpirationDate}" style="width: 300px" /> <apex:inputField value="{!quote.Currency__c}" style="width: 300px" /> <apex:inputField value="{!quote.Terms__c}"/> <apex:inputField value="{!quote.uptime_Support_Rep_Details__c}" style="width: 300px" /> <apex:inputField value="{!quote.uptime_Support_Rep_Email__c}" style="width: 300px" /> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>

 

 Error:

 

 

Invalid parameter value "" for parameter "id". Error: The value of the parameter specified above contains a character that is not allowed or the value exceeds the maximum allowed length. Remove the character from the parameter value or reduce the value length and re-submit. If the error still persists, please report it to our Customer Support team and provide the URL of the page you were requesting as well as any other related information.

 

Thus, I cannot load this VF page to even begin creating a new record.  By comparison, using a similar VF Page for the Contact object yields no such error:

 

 

<apex:page standardController="Contact" title="Contact"> <apex:form id="theForm"> <apex:pageBlock title="Contact Information"> <apex:pageMessages /> <apex:pageBlockButtons > <apex:commandButton action="{!save}" value="Save" /> <apex:commandButton action="{!cancel}" value="Cancel" /> </apex:pageBlockButtons> <apex:pageBlockSection title="Contact Information " columns="2" > <apex:inputField value="{!contact.FirstName}" required="true" /> <apex:inputField value="{!contact.LastName}" required="true" /> <apex:inputField value="{!contact.Salutation}" /> <apex:inputField value="{!contact.ContactType__c}" /> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>

 

 

 

 

 

 

CTU007CTU007

I think the issue is with this one:

 

 

<apex:inputField value="{!quote.Opportunity.Id}" id="oppId" required="true" />

 

 try change to

 

 

<apex:inputField value="{!quote.OpportunityId}" id="oppId" required="true" />

 

 

 

 

This was selected as the best answer
uptime_andrewuptime_andrew
Yeah, that was it, I figured it out a few hours before seeing your post :)