You need to sign in to do that
Don't have an account?
Abhish Chalke
JS function
after clickig on view all button
browser URL is changing as expected but page is not redirecting
window.open not working in VF page
<button class="btn-view-all" onclick="openall()">View All </button>
JS function
function openannouncement(){ var urlString=window.location.href; var baseURL = urlString.substring(0, urlString.indexOf("/_ui")); var siteBaseURL = baseURL + '/s'; var redirectUrl = siteBaseURL + '/viewall' window.open(redirectUrl,"_self"); }
after clickig on view all button
browser URL is changing as expected but page is not redirecting
https://trailblazers.salesforce.com/answers?id=9063A000000l10fQAA
https://developer.salesforce.com/forums/?id=9060G000000I6psQAC
Your query is answered above.
Try the suggestions mentioned above.
try below code it is working my vf page .
<script>
function openschemedetails() {
var id = "{!sam.Scheme_Master__c}";
var url = 'apex/scheme_detail?id='+id;
window.open('https://wel--wpc--c.visualforce.com/'+url,'_blank');
}
</script>
<apex:commandButton styleClass="slds-button slds-button_brand" value="View Details" onclick="openschemedetails(); return false;"/>
if you face any problem please let me know.
if it is work for you please mark as the best answer.
In your above code, your function in onclick should have the same function in JS.
Below I have put a solution for your code.
<button class="btn-view-all" onclick="openall()">View All </button>
JS function
function openall(){
var urlString=window.location.href;
var baseURL = urlString.substring(0, urlString.indexOf("/_ui"));
var siteBaseURL = baseURL + '/s';
var redirectUrl = siteBaseURL + '/viewall'
window.open(redirectUrl,"_self");
}
Please go through the above code, Reply if you have any doubt, and Mark it as Best Answer if it is helpful to you.
Thanks and Regards,
Malika Pathak.
<apex:pageBlockButtons location="top">
<apex:commandButton action="{!viewallAction}" value="View All"/>
</apex:pageBlockButtons>
VF Page Controller:
public PageReference viewallAction() {
PageReference page = new PageReference('/'+'viewall');
page.setRedirect(true);
return page;
}
Taco Bell is an American-based chain of fast-food restaurants originating in Irvine, California. It was founded in 1962 by Glen Bell, and Taco Bell is a subsidiary of Yum brands, Inc. Taco Bell Menu Breakfast with prices 2022