Custom Buttons in Service Cloud Console

Custom Buttons  in Service Cloud Console


{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")} 
{!REQUIRESCRIPT('/soap/ajax/35.0/apex.js')} 
{!REQUIRESCRIPT("/support/console/28.0/integration.js")}
//identify the id 
var c = new sforce.SObject("case"); 
c.id = "{!Case.Id}"; 
var Cstatus= "{!Case.Status}"; 
var resultOk = confirm("Are you sure,you want to clone the case"); 
if(resultOk){ 
var result = sforce.apex.execute("Casecloningfrombutton","cloneCaseList",{caseIds:"{!Case.Id}"}); 
alert(result);
if(result!=null){ 
var redirectUrl = '/'+result;
if (sforce.console.isInConsole()) {
sforce.console.getEnclosingTabId(function(enclosingResult){
sforce.console.getEnclosingPrimaryTabId(function(primaryResult){
sforce.console.openSubtab(primaryResult.id, redirectUrl, true, '', null);
});
});
}else{
window.location.href = redirectUrl;
}
}else{ 
alert('Insert failed - please contact with system admin'); 
}

No comments:

Post a Comment