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
Dan BroussardDan Broussard 

Passed CreateView Trailhead challenge BUT:

In the Trailhead section, Visualforece, Create View, I passed the test just fine.
When I wanted to see the result with an actual contact "id" https://na24.salesforce.com/0031a000003qngx
copied to the end of the url like this:
https://c.na24.visual.force.com/apex/ContactView/&id=0031a000003qngx or with no last "/"
https://c.na24.visual.force.com/apex/ContactView&id=0031a000003qngx

I get the following error
"The name can only contain underscores and alphanumeric characters. It must begin with a letter and be unique, and must not include spaces, end with an underscore, or contain two consecutive underscores. "
To what "name" do they reference?I have to be doing something really dumb!
Any help is appreciated
Here is my code:
<apex:page sidebar="false" standardController="Contact">
  <!-- Begin Default Content REMOVE THIS -->
  <h1>Congratulations</h1>
  This is your new Page: ContactView
  <!-- End Default Content REMOVE THIS -->
    <apex:pageBlock title="Contact Information">
        <apex:pageBlockSection >
            First Name:   {! Contact.FirstName } <br/>
            Last Name:    {! Contact.LastName} <br/> 
            Owner's Email:{! Contact.Owner.Email} <br/>           
            Phone:        {! Contact.Phone } <br/>
            Industry:     {! Contact.Account.Industry } <br/>
            Revenue:      {! Contact.Account.AnnualRevenue } <br/>
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:page>
Best Answer chosen by Dan Broussard
Andy BoettcherAndy Boettcher
It's the URL - you want the URL to be:

https://c.na24.visual.force.com/apex/ContactView?id=0031a000003qngx

Note the question mark instead of the ampersand.  The Ampersand is used to seperate / concatenate multiple URL variables, it all starts with the question mark.  =)

All Answers

Shashi PatowaryShashi Patowary
Hi Dan,

This is how you can pass id to VF page -

https://c.na24.visual.force.com/apex/ContactView?id=0031a000003qngx

Please let me know if this is helpful.

Regards,
Shashi
Andy BoettcherAndy Boettcher
It's the URL - you want the URL to be:

https://c.na24.visual.force.com/apex/ContactView?id=0031a000003qngx

Note the question mark instead of the ampersand.  The Ampersand is used to seperate / concatenate multiple URL variables, it all starts with the question mark.  =)
This was selected as the best answer
Dan BroussardDan Broussard
I knew it was something really dumb!!  I did not see the & thought it was ? 
Old eye balls failed me again!
Thank you very much, I completely missed the error!