问题描述
有人可以在我能找到的地方给出任何建议,代码或文档链接吗?
Could anybody give any piece of advice, or code, or documentation link where I can found:
- 如何绑定实体创建 '如果对话框以
的正值关闭, - 并更改其父实体的某些字段(如果对话框以
的负(取消)状态关闭了?
我还想知道如何将数据传递到对话框。
I also want to know how to pass data from and to dialog.
我说的是自定义aspx对话框(例如dlg_closeopp.aspx),而不是标准的对话框,即流程实体。
I am talking about custom aspx dialog (like dlg_closeopp.aspx) not standard dialog which is 'Process' entity.
我用以下绑定的js代码调用对话框在联系人实体的OnFieldChange事件上:
I call my dialog with the following js code which is bound on OnFieldChange event of Contact entity:
function onFieldChange() {
var oUrl = Mscrm.CrmUri.create("/SFA/conts/dlg_newone.aspx");
var callbackFunction = Mscrm.Utilities.createCallbackFunctionObject("performActionAfterDialogClose", this);
var ret_val = openStdDlgWithCallback(oUrl, document, 450, 420, callbackFunction);
}
function performActionAfterDialogClose(ret_val) {
if (ret_val) {
//Do Anything here
}
}
如果对话框上用户选择的数据符合我的条件,我需要创建一个活动。
I need to create an activity if the user-chosen data on the dialog meets my conditions.
谢谢。
推荐答案
要将实体数据传递到对话框:
To pass entity data to the dialog:
oUrl.get_query()['DialogId'] = dialogId;
oUrl.get_query()['ObjectId'] = entityId;
oUrl.get_query()['EntityName'] = objectTypeCode;
使用回调获取结果:
ret_val.setCallbackReference(function (result) { //created record based on result });
使用可以使用SDK根据结果创建记录。
Use can use the SDK to create records based on the result.
这篇关于CRM对话框创建实体并传递数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!