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
kutts18kutts18 

VF Page Transition Problem

I have created a site, and in one of the VF page i have link like this

<a class="title" href="/apex/newBlogEdit?id={!post.Id}" target="_top">
{!post.Name}</a>
This link takes the user to edit page.

But when the link is clicked it shows the message

 

 http://xxxxxx-developer-edition.na6.force.com/xxxxx/ is under construction
 Stay tuned. Please email us if you need to get in touch.

 

 

I have observed that, when page transition is done through

controller using PageReference, the page transits correctly

but if we call the page directly without using controller

method, then native page is getting displayed saying

"under construction". 

 

1. What will the possible cause?

2. Is a page never meant to call another page directly without controller?

 

Best Answer chosen by Admin (Salesforce Developers) 
RyanGuestRyanGuest

This could better be answered in the Sites forum:http://community.salesforce.com/sforce/board?board.id=sites

 

Does your site have a prefixed path? That's "abc" part of this url: http://xxxxxx-developer-edition.na6.force.com/abc/

 

Sounds like you could be linking to http://xxxxxx-developer-edition.na6.force.com/apex/newBlogEdit when you really want to link to http://xxxxxx-developer-edition.na6.force.com/abc/apex/newBlogEdit

 

Let us know if this works or not.

All Answers

RyanGuestRyanGuest

This could better be answered in the Sites forum:http://community.salesforce.com/sforce/board?board.id=sites

 

Does your site have a prefixed path? That's "abc" part of this url: http://xxxxxx-developer-edition.na6.force.com/abc/

 

Sounds like you could be linking to http://xxxxxx-developer-edition.na6.force.com/apex/newBlogEdit when you really want to link to http://xxxxxx-developer-edition.na6.force.com/abc/apex/newBlogEdit

 

Let us know if this works or not.

This was selected as the best answer
kutts18kutts18

Thanks a lot, Its exactly the URL problem.

Between checking the syntax i actually missed out the

url part.

 

Its working fine now. Thanks once again.

 

dchasmandchasman
Please please please do not hard code your links like this unless you have no other options - instead leverage the builtin in symbolic referencing support through features like $Page.newBlogEdit and urlFor() in VF formulas or PageReference and the builtin Page collection in Apex Code. URL generation will then be consistent regardless of the environment (e.g. if you hard code this in a managed package w/out the namespace you're going to have problems in any org that installs your package). In addition, when you leverage $Page etc VF can see this as a page reference and tracks it as a metadata dependency, enforces metadata referential integrity (keeps someone from be able to delete the ref'ed page out from under you), automatically adds the ref'ed page to any packages that need it, etc...