You need to sign in to do that
Don't have an account?
Ramesh 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:
If I execute $('.uiModal').style.display = 'none'; from browser console, it is closing dilog, but not from the visualforce page. Please help me.
<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.
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-------------------------------