添加到列表Dynamics CRM中的对话框
问题描述:
我在Dynamics中有一个自定义的表单,我想将一些联系人添加到列表中。我想使用内置的添加到列表形式如下:添加到列表Dynamics CRM中的对话框
_grid/cmds/dlg_addtolist.aspx
我希望能够做这样的事
window.showModalDialog("/" + organizationName + "/_grid/cmds/dlg_addtolist.aspx?
iObjType=2&iTotal=" + iTotal + "&itemObjectId=" + itemObjectId + "&itemObjectTypeCode=" + itemObjectTypeCode,
/* put the ids in here...but in what format? */);
但是当我尝试使用这个简单ID作为用于在showModalDialog调用的参数的JSON阵列,动态引发以下错误(在事件查看器)(表格弹出后,我点击确定继续):
Exception information:
Exception type: ArgumentOutOfRangeException
Exception message: Expected 'Guid' data type for 'iId' parameter in 'Request.QueryString'. The raw request was 'POST /Dynamics/_grid/cmds/dlg_addtolist.aspx?iObjType=2&iTotal=1&iIndex=0&itemObjectId=35b5B78B84B-675C-E011-AACF-00155D1FB10935d&itemObjectTypeCode=4300&iId=889169' called from http://crm.dev.com:8515/Dynamics/_grid/cmds/dlg_addtolist.aspx?iObjType=2&iTotal=2&itemObjectId={5B78B84B-675C-E011-AACF-00155D1FB109}&itemObjectTypeCode=4300.
我在做什么错?
谢谢。
答
使用Fiddler,我能够看到,当项目被添加到市场营销列表时,它是作为POST完成的,而不是GET请求。
URL格式为:
/{organizationName}/_grid/cmds/dlg_addtolist.aspx?iObjType={entityTypeCodeOfItemToBeAdded}
&iTotal=1&iIndex=2&itemObjectId={guidOfTheList}&itemObjectTypeCode=4300
&iId={guidOfTheItemToBeAdded}
每个项目被添加到列表中创造了一个独立的POST。