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
VirajViraj 

Need a Close button to return to "All Opportunity" View

Hi,
I have developed a application that runs on an external server. This application is embeded in the Salesforce site using "Display in existing window with sidebar" behaviour of "Custom Button or Link" option. This application has a close button in one of its GUI. When this close button is pressed I want it to return to the "All Opportunities" view.

1) How could I achieve this through an API call?
2) Also I want to later make this application an AppExchange application. Will your solution proposed for (1), will be get affected by this new situation?

Viraj
AcronymAcronym
Hi Viraj,

I don't think you can do this. The url for an oppty list is /006, but to default to a specific view you would need to add the view ID - /006?fcf=00BT0000001YfUh.  The problem is that the id for All Opportunities is different in every org.  So, you could hard code the All Opportunities view in one account, but not for an Appexchange App where that view Id will be different for different customers.

To change to that page after the close button is clicked you need to do something like window.parent.location.href = "/006".  You basically have to climb out of the IFrame (if security allows for it) and cause the main SFDC page to navigate to the relative url /006 (relative to https://<server>.salesforce.com).