Activity Forums Salesforce® Discussions How to Reload Page after an action using Javascript in Salesforce?

  • How to Reload Page after an action using Javascript in Salesforce?

  • PRANAV

    Member
    April 26, 2018 at 4:39 pm

    I want to Reload Page after an action using using Javascript. Please give me some solution for that or any code snippet will also helpfull.

    Thanks

  • Manpreet

    Member
    April 26, 2018 at 4:51 pm

    Hi pranav,

    You need to do something like this :

    <apex:commandButton action="{!onSave}" id="savex" value="Save" styleClass="slds-button slds-button--brand" onComplete="refreshPage();"
    function refreshPage(){
    window.location.top.reload();
    alert('Setting Saved');
    }

    Thanks.

  • Aman

    Member
    April 26, 2018 at 6:37 pm

    Hi Pranav,

    You can also use below snippet of code :

    <apex:commandButton value="Save" action="{!save}" onclick="window.top.location='/{!<object>.id}'; return true"/>

    Thanks

Viewing 1 - 3 of 3 posts

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos