0

我创建了一个自定义案例升级按钮(见下文),执行 javascript 以:

  1. 将案例所有者更改为队列
  2. 将案例状态更改为已升级
  3. 并允许支持代理在升级和父页面重新加载之前添加评论。

它工作正常,但支持代表希望新的评论页面呈现在同一个父页面中(与关闭案例按钮的工作方式相同),我只是无法弄清楚执行此操作的语法或功能。

它现在的工作方式是打开一个新窗口以添加评论,然后在保存此子窗口后关闭并使用更新的数据刷新父窗口。

非常感谢您的帮助!

{!REQUIRESCRIPT("/soap/ajax/13.0/connection.js")}

var caseObj = new sforce.SObject("Case");
caseObj.Id = '{!Case.Id}';
parent.ID='{!Case.ParentId}'
caseObj.Status = 'Escalated';
caseObj.OwnerId = '00GE0000001ZsMH';
onclick='window.close()';
window.open('/00a/e?parent_id={!Case.Id}&retURL=/{!Case.Id}');
var result = sforce.connection.update([caseObj]);

if (result[0].success=='false') {
     alert(result[0].errors.message);
} else {

     location.reload(true);
}
4

1 回答 1

0

There isn't really a good way you can do that with just a Javascript button. A better choice would be a little Visualforce page which allows the agent to enter the comment and sets the status and owner accordingly on save.

于 2013-01-07T01:36:52.083 回答