Im trying to do a custom simple save and new method in a custom controller. Basically its just a simple form for nominations with a table above it of all the already submitted nominations and the action is called nominate which just does

public PageReference nominate() { 
 insert newapplicant;
 // back to the same page with the proper query params
 PageReference pageRef = pageRef = new PageReference('/nominate?id='+NominationRound.id+'&key='+NominationRound.name);
 return pageRef;


the problem i am having is the record is saved fine but doesnt seem to be saved before the redirect happens because its not displaying on the page. If i just refresh the page again its there but thats not good, i want to be sure nominators see their nominations right away?

am i missing something odvious?


Adding a little more code here for clarity... also wanted to mention that all of this is working through an unauthenticated force.com pages and i'd quadruple checked permissions

here is the list in visualforce

Your Nominees
<table class="table">
 <apex:repeat value="{!applications}" var="application">

and the form is below it.. so the idea is that you save the nominee and then it refreshes the list.

I tried using rerender and i am still getting the delay? things show up eventually but not right away and not on initial load.

Is is possible slowness in the sandbox that wont be there in production? or is it related to the fact that its a publicably accessible page in sites?

  • 1
    I think you may want to rerender something instead of a page redirect. May help to show some of your Visualforce and explain more of what you're trying to realize. Commented Jul 2, 2013 at 18:45
  • 2
    You might consider making your custom controller a controller extension, and calling the standard controller's quicksave action.
    – metadaddy
    Commented Jul 2, 2013 at 19:00
  • Is there a trigger that calls a future method on the Applicant object? The inserted applicant might not appear in the list of nominations until this future method has been processed. Commented Jul 2, 2013 at 19:38
  • nope no triggers on anything... its really strange i dont understand whats causing the delay? Commented Jul 2, 2013 at 21:59

1 Answer 1


It sounds like it could be a caching issue. Check out Caching Force.com Sites Pages. The behavior is dependent on the configuration of your site (e.g., login-enabled) and apex:page cache and expires attributes.

  • 1
    YES! That was totally it. Unauthenticated pages are cached for 10 mins by default I added cache="false" to the page tag and it works perfectly! Commented Jul 2, 2013 at 22:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .