Activity Forums Salesforce® Discussions Can we call apex function and script function at the same time by clicking a button on Salesforce visualforce?

  • Radhakrishna

    Member
    August 11, 2017 at 9:03 am

    Hello Shariq,

    Instead of onclick try - oncomplete event.

    <apex:commandButton value="Save" action= "{!save}"
    Oncomplete="javascript:top.window.opener.closeFunction()" />

  • shariq

    Member
    August 11, 2017 at 1:24 pm

    Thanks Radhakrishna,

    This helps a lot.

     

  • Parul

    Member
    September 15, 2018 at 3:26 pm

    <apex:page>
    <script>
    function callActionFUnction(){
    call();
    }
    function saveHandler(){
    }
    </script>
    <apex:actionfunction action="{!saveFields }" oncomplete="saveHandler()" name="call" reRender="success"/>
    <apex:commandButton status="busy" value="Save" onclick="callActionFUnction()"/>
    </apex:page>

     

    Thanks

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos