更新:Here is the marketing list entity metadata。向下滾動,您可以看到多對多關係,您可以看到我嘗試使用的listcontact_association。使用休息創建實體關聯
我在嘗試將聯繫人與營銷列表關聯。這是我想使用(基本上POST與URI一個json):
curl --ntlm -u username:password -X POST -H "Content-Type: application/json" -d '{"uri":"http://hostname/XRMServices/2011/OrganizationData.svc/ContactSet%28guid%27<guid>%27%29"}' 'http://hostname/XRMServices/2011/OrganizationData.svc/ListSet%28guid%27<guid>%27%29/$links/listcontact_association'
這就是我從CRM接收:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code>-2147220989</code>
<message xml:lang="fi-FI">Invalid role specified for entity 'list'in relationship 'listcontact_association.Referenced'</message>
<innererror>
<message>Invalid role specified for entity 'list'in relationship 'listcontact_association.Referenced'</message>
<type>System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=<token>]]</type>
<stacktrace> at Microsoft.Crm.Extensibility.OrganizationDataServiceUpdateProvider.System.Data.Services.IUpdatable.SaveChanges()
at System.Data.Services.DataService`1.HandleNonBatchRequest(RequestDescription description)
at System.Data.Services.DataService`1.HandleRequest()</stacktrace>
</innererror>
</error>
如果我刪除了$links
部分,我得到一個不同的錯誤:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code></code>
<message xml:lang="fi-FI">Error processing request stream. The property name 'URI' specified for type 'Microsoft.Crm.Sdk.Data.Services.List' is not valid.</message>
這將導致我相信有一些我應該嘗試關聯該人的其他關係,但是我無法訪問CRM以查找此信息,並且文檔不是非常有用:(任何線索?
從我可以告訴,上面的curl命令完成相同的功能:/ – Zavior
它可能,我從來沒有使用過。 – Daryl