Custom detail buttons failed update the field and navigate back to the record detail page in salesforce 1. If you wants to make it work , you need to implement @remoteAnnotation.
Code follows as below.
<apex:page standardController="Opportunity" extensions="CallDetails">
Visualforce.remoting.Manager.invokeAction(
Code follows as below.
<apex:page standardController="Opportunity" extensions="CallDetails">
<apex:form >
<script
src="/soap/ajax/29.0/connection.js"></script>
<script type='text/javascript' src='/canvas/sdk/js/publisher.js'/>
<script src="https://mobile1.t.salesforce.com/soap/ajax/30.0/connection.js"
type="text/javascript" />
<script type="text/javascript">
window.onload=function(){
'{!$RemoteAction.emailOperations.sendEmailSF2}',
'{!Opportunity.Id}',
function(result, event) {
if (event.status) {
//do whatever rendering of the list you want
} else if (event.type === 'exception') {
//handle errors
} else {
//handle unknown responses
}
},
{escape:
true}
);
if(typeof sforce != 'undefined'&&sforce != null )
{ alert('continue?');
sforce.one.back(true);
alert('continue?');
Sfdc.canvas.publisher.publish({name:
"publisher.refresh", payload:{ refresh:"true"}});
}
}
</script>
</apex:form>
</apex:page>
0 Comments