Ok in crm 2011使用Odata Query - 如果工作流程Odata Set名称是AsyncOperationSet对话框的等价物是什么?
我试图弄明白没有运气
请帮忙
谢谢
P.s我需要从名称中获取对话框ID
答案 0 :(得分:1)
搜索通过javascript启动的对话框时:
类别= 1(对话框) Type = 1(定义) - 如果尝试从javascript调用对话框,这很重要!
解决方案:
triggerDialog = function (name, entityName, recordId) {
var dialogId = "";
var request = Xrm.Page.context.getServerUrl() + "/XRMServices/2011/OrganizationData.svc/WorkflowSet?$select=Name,WorkflowId&$filter=Type/Value eq 1 and Category/Value eq 1 and Name eq '"+name+"'";
$.ajax({
type: "GET",
contentType: "application/json; charset=utf-8",
datatype: "json",
url: request,
async: false,
beforeSend: function (XMLHttpRequest) {
XMLHttpRequest.setRequestHeader("Accept", "application/json");
},
success: function (data, textStatus, XmlHttpRequest) {
if (data.d.results.length > 0) {
dialogId = data.d.results[0].WorkflowId;
}
},
error: function (XmlHttpRequest, textStatus, errorThrown) {
/*Error Occurred*/
}
});
var serverUrl = Xrm.Page.context.getServerUrl();
window.showModalDialog(
serverUrl + "/cs/dialog/rundialog.aspx?DialogId=" + encodeURIComponent(dialogId) + "&EntityName=" + encodeURIComponent(entityName) + "&ObjectId=" + encodeURIComponent(recordId), null, "dialogHeight:600px;dialogWidth:800px;center:yes; resizable:1;maximize:1;minimize:1;status:no;scroll:no");
希望这有帮助
答案 1 :(得分:0)
仅供参考。 AsyncOperation不仅仅是工作流的实例。它可以是任何异步执行的(异步插件,计算重复检测规则的匹配代码等)。
不确定你想从Odata得到什么。你究竟需要得到什么?如果您需要一个对话框实例 - 您还需要使用AsyncOperation。