But, can we make this simple? Meaning just click a button to close an open case without have to open a new page. Yes, by using custom button. Here we go:
- Setup - Customize - Cases - Buttons, Links, and Actions
- Click New Button or Link, enter Label and Name, select Detail Page Button in Display Type and Behavior select Execute JavaScript
- Paste JavaScript script below
- Add custom button created to the page layout and remove default Close Case button, you can have multiple page layout with different button based on user profile and Case record type.
var caseObj = new sforce.SObject("Case");
caseObj.Id = '{!Case.Id}';
if ({!NOT(Case.IsClosed)}){
caseObj.Status = 'Closed';
var result = sforce.connection.update([caseObj]);
if (result[0].success=='false') {
alert(result[0].errors.message);
} else {
location.reload(true);
}
}
}
Another option is to enable Closed value available in Case Status. By default, this value will be not available when user Create or Edit the Case, but we can enable it. Here we go: Setup - Customize - Cases - Support Settings, enable Show Closed Statuses in Case Status Field. This will make Closed status available when user create or edit Case, user also will not bring into Case Close page any more.
In the same Case Support Setting page, admin also can hide Save & Close button by enable Hide Save & Close Button and Cls Links.
How about if I want to limit only certain profiles can close case?
Easy... create validation rule with this formula, sample:
RecordType.Name = 'CSD Case' && ISCHANGED(IsClosed)
Read this document for more information on Closing Cases.
No comments:
Post a Comment