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
JosephTJosephT 

Calling Last Case View/Session ID from VF Button

I created a new 'Return to Case View" button on the Case Feed Publishers.  I am trying to allow users to return to the Last Case View they were looking.  However, when I click my button, the case view is displayed within an iframe...  How can I refresh the entire URL and bring them back to their 'last' case view?

sfdcfoxsfdcfox

Use a commandLink; make sure the target is set to "_top".

JosephTJosephT

Thank you.

 

Here is my current code which opens the Cases Tab within the iFrame;

 

<apex:page standardcontroller="Case">

<apex:form >

<apex:commandButton value="Refresh" onclick="window.top.location='/na5.salesforce.com/500/o'; return false" />

</apex:form>

<apex:ListViews type="Case" />

</apex:page>

 

However, when I add the command link, set to top, it automatically refreshes the page when you open the case...  It does not work on the 'onclick' command, it just refreshes the page automatically.

 

What I am trying to get it to do is bring the user back to their "Last Cases Tab View" when they click the button...

sfdcfoxsfdcfox
<apex:page >
    <apex:form >
        <apex:commandButton onclick="window.top.location.href='/500';return false;"/>
    </apex:form>
</apex:page>

This works in my developer org, at least, far as I can tell.

JosephTJosephT

 

Thank you.  That works BUT, when I use this code, an iFrame window still opens up in my view and. I still have to push another button to refreash the entire page...

 

Here is a snap shot of what I am seeing...

 

 

 

Return to Case View Image

sfdcfoxsfdcfox

"Return to case view 2" should contain the onclick JavaScript in order to have it work correctly.