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
Ramesh Maamidi 6Ramesh Maamidi 6 

Unable to close dialog

I created a QUick action which open the Visualforce page. On opening that dialog, I want to perform some operation and, close the dialog. But, I'm unable to close the dialog.  Here is my code:
<apex:page standardController="Order__c">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="/resource/jquery"></script>
  <script type="text/javascript">
    Sfdc.onReady(function() {
        alert();
        $('.uiModal').style.display = 'none';
    });
  </script>
  <p>Uncancelling...</p>
</apex:page>

If I execute $('.uiModal').style.display = 'none'; from browser console, it is closing dilog, but not from the visualforce page. Please help me.
Jack Yu@TokyoJack Yu@Tokyo
if you want to do some operation by click the custom button. you can add a custom button to excute javascript. 
Code as below, hope it will help you.

------------------------------------------------------------Code Start-------------------------------
{!REQUIRESCRIPT("/soap/ajax/31.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/31.0/apex.js")} 

if (window.confirm("are you sure to do some operation?")) { 

    var result = sforce.apex.execute('WebServiceUtilClass','do_some_operation_method',{salesforceId:"{!Order__c.Id}"}); 

    if(result[0].success == 'failed') { 
        alert("It was failed,Please contact administrator。"); 
    } else{ 
        location.reload(); 
    } 


    location.reload(); 
}

------------------------------------------------------------Code End-------------------------------