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
razzazrazzaz 

Button Help?

Hi:
   Is there a way to place a custom print button on the tickets(Cases) queue screen where an user can select the the tickets they want and hit the print button to print the details of the tickets one by one....
Also, is there a way to disable a button according to the ticket reason... like I would like to disable the close button on the ticket for one special reason?
Thanks
 
michaelforcemichaelforce

The printing question is a good one... for that there may be an AppExchange app that can help you.  The closing criteria can definitely be implemented though.

If you check out the "buttons and links" section for Cases you will see that you can override the "Close" and "Mass Close" functions (the functions run when you close a Case from the record screen, or when you close multiple from a list view, respectively).

You can override these with simple s-controls that will just check the Reason field (or any other criteria) and if all checks out you can redirect the browser to the standard Close and Mass Close pages as needed. (e.g. "{!URLFOR(t $Action.Case.CloseCase , id, [inputs], true)}" )

Hope this helps.

shan876shan876

Ok so I got it to work in ajax but have not gotten it to work in override... now one thing with this override s-control button stuff... do we place in the code for the button on the s-control...

</head>
<body>
<form>
<INPUT TYPE="button" NAME="myButton" VALUE="Zshan Test" onClick="init();">
</form>
</body>

well this is my code based on ticket reason... could someone point me to how to place this in the override button thing ... please

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<script type="text/javascript" language="javascript" src="/js/functions.js"></script>
<script type="text/javascript" language="javascript" src="/soap/ajax/11.1/connection.js"></script>
<script>
function init() {
var cReason = {!Case.Reason};
var newURL="{!URLFOR($Action.Case.CloseCase , Case.Id, null, false)}" ;

//cReason="Delivery Issues";
if (cReason=="Delivery Issues")
{
//Disable the Close button
alert("Not Authorize to Close because Ticket Reason is-Delivery Issues")
}
else
{
//Redirect to Close Edit Page
window.parent.location.replace(newURL);
//alert(newURL);
}
}
</script>
</head>
</html>


 

 

shan876shan876

Redid my code but everytime I override the close button it goes to a blank page .. does anyone know what am I doing wrong please...

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<script type="text/javascript" language="javascript" src="/js/functions.js"></script>
<script type="text/javascript" language="javascript" src="/soap/ajax/11.1/connection.js"></script>
<script>
function init() {
var cReason = "{!Case.Reason}";
var newURL="{!URLFOR($Action.Case.CloseCase , Case.Id, null, false)}" ;

//cReason="Delivery Issues";
if (cReason=="Delivery Issues")
{
//Disable the Close button
alert("Not Authorize to Close because Ticket Reason is-Delivery Issues")
}
else
{
//Redirect to Close Edit Page
window.parent.location.replace(newURL);
//alert(cReason);
//alert(newURL);
}
}
</script>
<style>

.btn, .button, .formulaButton, .btnWhatsNew {
font-family: 'Verdana', 'Geneva', sans-serif;
background-repeat: repeat-x;
background-position: left top;
border-right:1px solid #5C5D61;
border-bottom:1px solid #5C5D61;
border-top:none;
border-left:none;
font-size: 80%;
color:#FFFFFF;
padding:1px 3px 1px 3px;
cursor:pointer;
font-weight:bold;
display:inline;
}
</style>
</head>
<!--<body>
<form>
<INPUT TYPE="button" class="btn" NAME="myButton" VALUE="Zshan Test" onClick="init();">
</form>
</body>-->

</html>


 

michaelforcemichaelforce

Change the last argument of the URLFOR statement to "true".  That might do it.  It's the 'no override' input which controls whether the URL is that of the original action or of any overrides (s-controls).