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

  • 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

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos