You need to sign in to do that
Don't have an account?
jjuez
I need to extend this code to force it only when:
Closed case + condition must have a solution
Hi all,
I would like to be able to force users to have a solution linked to a case before they can close the case. Salesforce provides the following code, which works great:
Code:
<html> <head> <script src="/soap/ajax/13.0/connection.js"> </script> <script> function init() { var queryResult = sforce.connection.query("Select count() from CaseSolution Where CaseId = '{!Case.Id}'"); var size = queryResult.size; if (size > 0) { //go to the standard case close page without invoking the override window.parent.location.href = "{!URLFOR($Action.Case.CloseCase, Case.Id, [retURL=URLFOR($Action.Case.View, Case.Id)], true)}" } else { alert("Case must contain at least one solution before it can be closed."); //go to the standard case detail page this.parent.location.href = "{!URLFOR($Action.Case.View, Case.Id)}"; } } </script> </head> <body onload="init()"> <p> </p> </body> </html>
I need to extend this code to force it only when:
there is no solution linked to the case, and 2 specific values are selected in 2 different case picklist fields.
I have tried different things but nothing works.
Does anyone know? Thank you very much
Julian
Hi,
I was so happy to find this code, but have no idea where to use it. Is it an s-control or what? Can anyone help?
Thank you-
Lisa
Lisa,
1. Create a new S-Control, Type = HTML, and just copy/paste the code
2. Override the "Close Case" button with your S-Control
However, I am still not able to add one extra condition (which is the value of a picklist field). I always get "error on page" messages when clicking on the button.
Anyone who can help me??
Thank you