用Javascript打开CRM约会提示
我正在使用ActiveXObjectOutlook.Application来显示新的约会窗口。项目类型为OLAppoimment 现在,客户确实要求它不应该是默认约会,而应该是CRM约会项。如果用户安装了OutlookCRM插件,是否有任何方法可以做到这一点 守则:用Javascript打开CRM约会提示,javascript,outlook,dynamics-crm-2011,Javascript,Outlook,Dynamics Crm 2011,我正在使用ActiveXObjectOutlook.Application来显示新的约会窗口。项目类型为OLAppoimment 现在,客户确实要求它不应该是默认约会,而应该是CRM约会项。如果用户安装了OutlookCRM插件,是否有任何方法可以做到这一点 守则: this.setAppointment = function (data) { try { out = new ActiveXObject("Outlook.Application"); appt = **out.C
this.setAppointment = function (data) {
try {
out = new ActiveXObject("Outlook.Application");
appt = **out.CreateItem(1);** //here I'd love to have CRM Apointment type
appt.Subject = data.Subject;
appt.Location = data.Location;
appt.Start = formatDateForOutlook(data.Start);
appt.ReminderMinutesBeforeStart = data.ReminderMinutesBeforeStart;
appt.Display();
} catch (err) {
if (console && console.error) {
console.error(err);
} else {
alert(err);
}
}
}
当我说CRM约会项目时,我指的是这个视图
编辑:
我刚刚发现,我需要做的唯一一件事就是自动设置字段。因此,如果我能做一些事情,比如:
this.setAppointment = function (data) {
try {
out = new ActiveXObject("Outlook.Application");
appt = **out.CreateItem(1);** //here I'd love to have CRM Apointment type
appt.Subject = data.Subject;
appt.Location = data.Location;
appt.Start = formatDateForOutlook(data.Start);
appt.ReminderMinutesBeforeStart = data.ReminderMinutesBeforeStart;
appt.RegardingObjectId = { Id: {guid}, LogicalName: "EntityName" } //Ofc it's not working because of error: "Object doesn't support this property or method"
appt.Display();
} catch (err) {
if (console && console.error) {
console.error(err);
} else {
alert(err);
}
}
}
任何帮助、建议或解决方法都将不胜感激
appt.RegardingObjectId = { Id: {guid}, LogicalName: "EntityName" }
你想引用什么样的对象?如果是这样的话,应该是这样的
appt.RegardingObjectId = { Id: {guid}, LogicalName: "incident" }
还有索沃斯等等。相关对象需要知道ID属于哪个实体
编辑:此外,您还可以使用类似以下内容从javascript中提取实体名称
entityname = Xrm.Page.getAttribute("<FIELD>").getValue()[0].typename;
我试过处理这件事,但还是不走运。问题是,我假设,这个ActiveXObject不支持这个,我将无法实现它