分享方式:


Microsoft Dynamics 365 Web API 限制

 

發佈日期: 2017年1月

適用對象: Dynamics 365 (online)、Dynamics 365 (on-premises)、Dynamics CRM 2016、Dynamics CRM Online

Microsoft Dynamics 365 Web API 會透過組織服務的各項功能提供完整的同位檢查。 對於 Microsoft Dynamics 365 (線上和內部部署),本主題描述其中部分限制。

本主題內容

Microsoft Dynamics 365 (Online) 的 2016 年 12 月更新 和 Microsoft Dynamics 365 (內部部署) 的 2016 年 12 月 Service Pack 中的限制

Microsoft Dynamics 365 (Online) 的 2016 年 12 月更新 和 Microsoft Dynamics 365 (內部部署) 的 2016 年 12 月 Service Pack 中解決的限制

Microsoft Dynamics CRM Online 2016 更新 1 和 Microsoft Dynamics CRM 2016 Service Pack 1 中解決的限制

Microsoft Dynamics CRM Online 2016 更新 0.1 和 Microsoft Dynamics CRM 2016 更新 0.1 中解決的限制

Microsoft Dynamics 365 (Online) 的 2016 年 12 月更新 和 Microsoft Dynamics 365 (內部部署) 的 2016 年 12 月 Service Pack 中的限制

本節提供 Microsoft Dynamics 365 (Online) 的 2016 年 12 月更新 和 Microsoft Dynamics 365 (內部部署) 的 2016 年 12 月 Service Pack 中限制的相關資訊。

  • 某些自訂動作未在 Web API 中提供

  • 部分組織服務訊息喪失功能和動作

某些自訂動作未在 Web API 中提供

如果您定義的自訂動作包括複雜的傳回值和簡單的傳回值,對應的動作無法在 Web API 中使用,但可使用 2011 SOAP 端點提供。 複雜傳回值是 EntityReferenceEntityEntityCollection。 您可以任意組合簡單傳回值或單一複雜傳回值。其他資訊:建立自己的動作

部分組織服務訊息喪失功能和動作

下表列出沒有對應功能或動作的訊息,在套用 Microsoft Dynamics 365 (Online) 的 2016 年 12 月更新 和 Microsoft Dynamics 365 (內部部署) 的 2016 年 12 月 Service Pack 後。

GrantAccessRequest

ModifyAccessRequest

ReactivateEntityKeyRequest

RemoveMemberListRequest

RemoveItemCampaignRequest

RemoveItemCampaignActivityRequest

如需初始版本中喪失的功能和動作,請結合此清單羽 Microsoft Dynamics CRM Online 2016 更新 0.1 和 Microsoft Dynamics CRM 2016 更新 0.1 中新增的功能和動作 和 Microsoft Dynamics CRM Online 2016 更新 1 和 Microsoft Dynamics CRM 2016 Service Pack 1 中新增的功能和動作 下的清單。

Microsoft Dynamics 365 (Online) 的 2016 年 12 月更新 和 Microsoft Dynamics 365 (內部部署) 的 2016 年 12 月 Service Pack 中解決的限制

本節提供 Microsoft Dynamics 365 (Online) 的 2016 年 12 月更新 和 Microsoft Dynamics 365 (內部部署) 的 2016 年 12 月 Service Pack 中解決的限制相關資訊。

  • 未啟用 Microsoft Dynamics 365 for Outlook with Offline Access 的 Web API,在使用者離線時

  • 無法查詢日期值

  • 使用實體集合參數以及其他參數呼叫動作時,必須將集合參數做為本文中的最後一個參數傳遞

  • 無法建立客戶查詢屬性

  • 無法擷取未發行的中繼資料

新增新作業

以下作業已新增至 Microsoft Dynamics 365 (Online) 的 2016 年 12 月更新 和 Microsoft Dynamics 365 (內部部署) 的 2016 年 12 月 Service Pack 的 Web API。

QualifyLead Action

RetrieveByResourcesService Function

RetrieveFilteredForms Function

未啟用 Microsoft Dynamics 365 for Outlook with Offline Access 的 Web API,在使用者離線時

備註

此問題已在 Microsoft Dynamics 365 (Online) 的 2016 年 12 月更新 和 Microsoft Dynamics 365 (內部部署) 的 2016 年 12 月 Service Pack 中解決。

在表單指令碼、功能區命令或 HTML Web 資源中執行的 JavaScript 程式碼無法使用 Web API。 當使用者離線時,它現在會在使用的本機伺服器上啟用。

無法查詢日期值

此問題實際上並非限制,只是語法問題。 指定日期做為篩選值時,請勿使用單引號。

當查詢日期屬性時,例如連絡人的生日,下列查詢語法可運作。

/contacts?$select=fullname,birthdate&$filter=birthdate eq 1990-01-01

下列語法無法運作:

/contacts?$select=fullname,birthdate&$filter=birthdate eq '1990-01-01'

使用實體集合參數以及其他參數呼叫動作時,必須將集合參數做為本文中的最後一個參數傳遞

備註

此問題已在 Microsoft Dynamics 365 (Online) 的 2016 年 12 月更新 和 Microsoft Dynamics 365 (內部部署) 的 2016 年 12 月 Service Pack 中解決。

以下動作包含實體集合參數,除了其他參數之外。

AddListMembersList Action

AddPrivilegesRole Action

CompoundUpdateDuplicateDetectionRule Action

DeliverIncomingEmail Action

DeliverPromoteEmail Action

InstantiateTemplate Action

QualifyMemberList Action

ReplacePrivilegesRole Action

SendTemplate Action

SetLocLabels Action

在 Microsoft Dynamics 365 (Online) 的 2016 年 12 月更新 和 Microsoft Dynamics 365 (內部部署) 的 2016 年 12 月 Service Pack 之前,當您使用這些動作時,包括實體集合的參數必須做為 JSON 中的最後一個參數傳遞,否則系統會傳回錯誤。 例如,當您使用 QualifyMemberList Action 並以下列方式傳遞參數值時,將會收到錯誤。

{
"ListMember": [
  {
   "@odata.type": "Microsoft.Dynamics.CRM.account",
   "accountid": "483F8080-6976-E511-9172-0024E8436263"
  },
  {
   "@odata.type": "Microsoft.Dynamics.CRM.account",
   "accountid": "4D3F8080-6976-E511-9172-0024E8436263"
  }
 ],
"OverrideorRemove": true
}

但是下列方式應該會成功。

{
 "OverrideorRemove": true,
 "ListMember": [
  {
   "@odata.type": "Microsoft.Dynamics.CRM.account",
   "accountid": "483F8080-6976-E511-9172-0024E8436263"
  },
  {
   "@odata.type": "Microsoft.Dynamics.CRM.account",
   "accountid": "4D3F8080-6976-E511-9172-0024E8436263"
  }
 ]
}

無法建立客戶查詢屬性

備註

此問題已在 Microsoft Dynamics 365 (Online) 的 2016 年 12 月更新 和 Microsoft Dynamics 365 (內部部署) 的 2016 年 12 月 Service Pack 中解決。

使用 Web API 建立客戶查詢屬性,在 Microsoft Dynamics CRM Online 2016 更新 1 和 Microsoft Dynamics CRM 2016 Service Pack 1 中不支援。

若要使用 Microsoft Dynamics 365 (Online) 的 2016 年 12 月更新 和 Microsoft Dynamics 365 (內部部署) 的 2016 年 12 月 Service Pack 透過 Web API 建立客戶查詢屬性,請參閱建立客戶查詢屬性

無法擷取未發行的中繼資料

備註

此問題已在 Microsoft Dynamics 365 (Online) 的 2016 年 12 月更新 和 Microsoft Dynamics 365 (內部部署) 的 2016 年 12 月 Service Pack 中解決。

擷取中繼資料的組織服務訊息包括 RetrieveAsIfPublished 參數,可提供選項來傳回尚未透過發行認可的中繼資料定義。 此功能非常實用,當您建立要用來編輯中繼資料的應用程式且需要允許儲存未經認可的變更時。 在 Microsoft Dynamics CRM Online 2016 更新 1 和 Microsoft Dynamics CRM 2016 Service Pack 1 中,所有對中繼資料的擷取作業只會傳回已發行的中繼資料。其他資訊:使用 Web API 搭配 Dynamics 365 中繼資料發行自訂.

Microsoft Dynamics CRM Online 2016 更新 1 和 Microsoft Dynamics CRM 2016 Service Pack 1 中解決的限制

Microsoft Dynamics CRM Online 2016 更新 1 和 Microsoft Dynamics CRM 2016 Service Pack 1 新增了功能和動作,並解決了下列 Web API 相關問題:

  • Microsoft Dynamics CRM Online 2016 更新 1 和 Microsoft Dynamics CRM 2016 Service Pack 1 中新增的功能和動作

  • 無法篩選查詢,根據單一值導覽屬性的值

Microsoft Dynamics CRM Online 2016 更新 1 和 Microsoft Dynamics CRM 2016 Service Pack 1 中新增的功能和動作

下表列出 Microsoft Dynamics CRM Online 2016 更新 1 和 Microsoft Dynamics CRM 2016 Service Pack 1 中新增的功能和動作。

Book Action

Reschedule Action

CalculateRollupField Function

無法篩選查詢,根據單一值導覽屬性的值

備註

此問題已在 Microsoft Dynamics CRM Online 2016 更新 1 和 Microsoft Dynamics CRM 2016 Service Pack 1 中部分解決。 現在您可以在單一值導覽屬性上篩選查詢,如果導覽屬性參考的主要屬性值屬於參考的實體。其他資訊:根據單一值導覽屬性篩選記錄

如果您使用單一值導覽屬性的屬性做為查詢中的篩選,將會看見 501 錯誤。 例如,下列查詢嘗試傳回所有客戶,其中相關的主要連絡人 firstname 屬性值為 "Renee"。

  • 要求

    GET 
    [Organization URI]/api/data/v8.0/accounts?$select=name&$filter=primarycontactid/firstname eq 'Renee' HTTP/1.1
    Accept: application/json
    OData-MaxVersion: 4.0
    OData-Version: 4.0
    
  • 回覆

    HTTP/1.1 501 Not Implemented
    Content-Type: application/json; odata.metadata=minimal
    OData-Version: 4.0
    
    {  
     "error": {    
      "code": "",
       "message": "The query node (0) is not supported",
       "innererror": {      
       "message": "The query node (0) is not supported",
       "type": "Microsoft.Crm.CrmHttpException",
       "stacktrace": 
                            <stacktrace value removed for brevity>
      }  
     }
    }
    

Microsoft Dynamics CRM Online 2016 更新 0.1 和 Microsoft Dynamics CRM 2016 更新 0.1 中解決的限制

Microsoft Dynamics CRM Online 2016 更新 0.1 和 Microsoft Dynamics CRM Online 2016 更新 0.1 新增了功能和動作,並解決了下列 Web API 相關問題。

  • Microsoft Dynamics CRM Online 2016 更新 0.1 和 Microsoft Dynamics CRM 2016 更新 0.1 中新增的功能和動作

  • 查詢自我參考多對多關聯時發生錯誤

  • 某些 $expand 運算式上的 $select 可能會被忽略

  • 單一值導覽屬性可能不會從 $expand 查詢傳回,如果它們擁有 null 值

  • 連結至 activitypointer 的 FetchXML 查詢可能未包含連結的欄位

  • Null 值屬性可能不會傳回,在展開的導覽屬性結果中

Microsoft Dynamics CRM Online 2016 更新 0.1 和 Microsoft Dynamics CRM 2016 更新 0.1 中新增的功能和動作

下表列出 Microsoft Dynamics CRM Online 2016 更新 0.1 和 Microsoft Dynamics CRM 2016 更新 0.1 中新增的功能和動作。

CheckIncomingEmail Function

FindParentResourceGroup Function

GetQuantityDecimal Function

IncrementKnowledgeArticleViewCount Function

InitializeFrom Function

IsValidStateTransition Function

QueryMultipleSchedules Function

RetrieveAllEntities Function

RetrieveDuplicates Function

RetrieveLocLabels Function

RetrievePrincipalAccess Function

RetrieveRecordWall Function

RetrieveUnpublishedMultiple Function

SearchByBodyKbArticle Function

SearchByKeywordsKbArticle Function

SearchByTitleKbArticle Function

ValidateRecurrenceRule Function

查詢自我參考多對多關聯時發生錯誤

備註

此問題已在 Microsoft Dynamics CRM Online 2016 更新 0.1 和 Microsoft Dynamics CRM 2016 更新 0.1 中解決。

有兩個具有自我參考多對多關聯的系統實體:connectionrole EntityTypeconnectionroleassociation_associationcampaign EntityTypecampaigncampaign_association。 如果您嘗試使用這些集合值導覽屬性進行查詢時,預期會出現下列 HTTP Status 400 錯誤:Reflexive relationship must specify direction using ReflexiveManyToManyRelationship.

如果您需要使用這些多對多關聯查詢資料,可以改用交集實體。 對於 campaigncampaign_association 集合值導覽屬性,campaignitem EntityType 實體是定義關聯的特殊交集實體。 對於 connectionroleassociation_associationconnectionroleassociation 是一般交集實體,包含定義此多對多關聯的資料。 一般交集實體不會包括在參考文件中,但會在 Web API 中提供。 您可以使用此 URI 存取 connectionroleassociation 實體:/api/data/v8.0/connectionroleassociations。其他資訊:集合值導覽屬性

某些 $expand 運算式上的 $select 可能會被忽略

備註

此問題已在 Microsoft Dynamics CRM Online 2016 更新 0.1 和 Microsoft Dynamics CRM 2016 更新 0.1 中解決。

當擷取兩個導覽屬性時,如果最後一個導覽屬性沒有 $select 查詢選項,則第一個導覽屬性的所有屬性都會傳回。 例如,假設您建構了下列查詢:

GET 
[Organization URI]/api/data/v8.0/accounts(0495779B-F67F-E511-80C2-00155DB09B03)$select=name&$expand=contact_customer_accounts($select=lastname),opportunity_customer_accounts

您預期會收到客戶的 name 屬性,使用 contact_customer_accounts 建立關聯的連絡人 lastname,以及使用 opportunity_customer_accounts 建立關聯的商機的所有屬性。

不過,您將取得連絡人的所有屬性以及相關商機的所有屬性。 最好的做法是一律使用 $select 限制任何擷取作業的屬性,遵循此最佳作法將可確保獲得最佳效能,且不會擷取不需要的資料。

單一值導覽屬性可能不會從 $expand 查詢傳回,如果它們擁有 null 值

備註

此問題已在 Microsoft Dynamics CRM Online 2016 更新 0.1 和 Microsoft Dynamics CRM 2016 更新 0.1 中解決。

根據 OData 規格,當您展開單一導覽屬性且它未包含值時,屬性應隨附於 null 集合。 目前行為是,屬性不會包含在 JSON 回覆中。 在下列範例中,客戶 primarycontactid 單一值導覽屬性已要求,但是由於沒有與該導覽屬性相關的連絡人,因此值為 null。

  • 要求

    GET 
    [Organization URI]/api/data/v8.0/accounts(25DD0B31-ED8B-E511-80D2-00155D2A68D4)?$select=name&$expand=primarycontactid($select=fullname) HTTP/1.1
    Accept: application/json
    Content-Type: application/json; charset=utf-8
    OData-MaxVersion: 4.0
    OData-Version: 4.0
    
  • 預期的回覆

    HTTP/1.1 200 OK
    OData-Version: 4.0
    
    {
     "@odata.context": "
    [Organization URI]/api/data/v8.0/$metadata#accounts(name,primarycontactid,primarycontactid(fullname))/$entity",
     "@odata.etag": "W/\"504724\"",
     "name": "A. Datum Corporation (sample)",
     "accountid": "25dd0b31-ed8b-e511-80d2-00155d2a68d4",
     "primarycontactid": null
    }
    
  • 實際回覆

    HTTP/1.1 200 OK
    OData-Version: 4.0
    
    {
     "@odata.context": "
    [Organization URI]/api/data/v8.0/$metadata#accounts(name,primarycontactid,primarycontactid(fullname))/$entity",
     "@odata.etag": "W/\"504724\"",
     "name": "A. Datum Corporation (sample)",
     "accountid": "25dd0b31-ed8b-e511-80d2-00155d2a68d4"
    }
    

連結至 activitypointer 的 FetchXML 查詢可能未包含連結的欄位

備註

此問題已在 Microsoft Dynamics CRM Online 2016 更新 0.1 和 Microsoft Dynamics CRM 2016 更新 0.1 中解決。

當您使用 FetchXML 建立查詢,其包含 activitypointer 做為連結的實體,屬性值將會是 null。 例如,假設您使用下列 fetchXML:

<fetch version="1.0"
       output-format="xml-platform"
       mapping="logical"
       distinct="true">
  <entity name="account">
    <attribute name="name" />
    <link-entity name="activitypointer"
                 from="regardingobjectid"
                 to="accountid"
                 link-type="inner">
      <attribute name="subject" />
    </link-entity>
  </entity>
</fetch>

您要求相關的 activitypointer。 要傳回的 subject 值。 實際值存在時,會傳回 null 值。

  • 要求

    GET 
    [Organization URI]/api/data/v8.0/accounts?fetchXml=%3Cfetch%20version=%221.0%22%20output-format=%22xml-platform%22%20mapping=%22logical%22%20distinct=%22true%22%3E%3Centity%20name=%22account%22%3E%3Cattribute%20name=%22name%22%20/%3E%3Clink-entity%20name=%22activitypointer%22%20from=%22regardingobjectid%22%20to=%22accountid%22%20link-type=%22inner%22%3E%3Cattribute%20name=%22subject%22%20/%3E%3C/link-entity%3E%3C/entity%3E%3C/fetch%3E HTTP/1.1
    Accept: application/json
    OData-MaxVersion: 4.0
    OData-Version: 4.0
    
  • 預期的回覆

    HTTP/1.1 200 OK
    Content-Type: application/json; odata.metadata=minimal
    OData-Version: 4.0
    
    {
     "@odata.context": "
    [Organization URI]/api/data/v8.0/$metadata#accounts(name)",
     "value": [
      {
       "name": "A. Datum Corporation (sample)",
       "activitypointer1.subject": "Task Subject Value"
      }
     ]
    }
    
  • 實際回覆

    HTTP/1.1 200 OK
    Content-Type: application/json; odata.metadata=minimal
    OData-Version: 4.0
    
    {
     "@odata.context": "
    [Organization URI]/api/data/v8.0/$metadata#accounts(name)",
     "value": [
      {
       "name": "A. Datum Corporation (sample)",
       "activitypointer1.subject": null
      }
     ]
    }
    

其他資訊:使用自訂 FetchXML

Null 值屬性可能不會傳回,在展開的導覽屬性結果中

備註

此問題已在 Microsoft Dynamics CRM Online 2016 更新 0.1 和 Microsoft Dynamics CRM 2016 更新 0.1 中解決。

當集合值導覽屬性的其中一個展開的屬性為 null 時,展開的屬性將不會包含在結果中。 第一個範例顯示的資料是,當其中一個與客戶相關的連絡人其展開的 emailaddress1 屬性擁有 null 值時。emailaddress1 屬性不會傳回,即使是對擁有值的連絡人。

  • 要求

    GET 
    [Organization URI]/api/data/v8.0/accounts(25DD0B31-ED8B-E511-80D2-00155D2A68D4)?$select=name&$expand=contact_customer_accounts($select=emailaddress1,lastname,firstname) HTTP/1.1
    Accept: application/json
    Content-Type: application/json; charset=utf-8
    OData-MaxVersion: 4.0
    OData-Version: 4.0
    
  • 預期的回覆

    HTTP/1.1 200 OK
    Content-Type: application/json; odata.metadata=minimal
    OData-Version: 4.0
    
    {
     "@odata.context": "
    [Organization URI]/api/data/v8.0/$metadata#accounts(name,contact_customer_accounts,contact_customer_accounts(emailaddress1,lastname,firstname))/$entity",
     "@odata.etag": "W/\"504724\"",
     "name": "A. Datum Corporation (sample)",
     "accountid": "25dd0b31-ed8b-e511-80d2-00155d2a68d4",
     "contact_customer_accounts": [
      {
       "@odata.etag": "W/\"504749\"",
       "emailaddress1": null,
       "lastname": "Valdes (sample)",
       "firstname": "Rene",
       "contactid": "8bdd0b31-ed8b-e511-80d2-00155d2a68d4"
      },
      {
       "@odata.etag": "W/\"503647\"",
       "emailaddress1": someone_l@example.com,
       "lastname": "Burk (sample)",
       "firstname": "Susan",
       "contactid": "91dd0b31-ed8b-e511-80d2-00155d2a68d4"
      }
     ]
    }
    
  • 實際回覆

    HTTP/1.1 200 OK
    Content-Type: application/json; odata.metadata=minimal
    OData-Version: 4.0
    
    {
     "@odata.context": "
    [Organization URI]/api/data/v8.0/$metadata#accounts(name,contact_customer_accounts,contact_customer_accounts(emailaddress1,lastname,firstname))/$entity",
     "@odata.etag": "W/\"504724\"",
     "name": "A. Datum Corporation (sample)",
     "accountid": "25dd0b31-ed8b-e511-80d2-00155d2a68d4",
     "contact_customer_accounts": [
      {
       "@odata.etag": "W/\"504749\"",
       "lastname": "Valdes (sample)",
       "firstname": "Rene",
       "contactid": "8bdd0b31-ed8b-e511-80d2-00155d2a68d4"
      },
      {
       "@odata.etag": "W/\"503647\"",
       "lastname": "Burk (sample)",
       "firstname": "Susan",
       "contactid": "91dd0b31-ed8b-e511-80d2-00155d2a68d4"
      }
     ]
    }
    

下列查詢直接使用 contact_customer_accounts 集合值導覽屬性而不展開,並且會傳回預期的資料。

  • 要求

    GET 
    [Organization URI]/api/data/v8.0/accounts(25DD0B31-ED8B-E511-80D2-00155D2A68D4)/contact_customer_accounts?$select=emailaddress1,lastname,firstname HTTP/1.1
    Accept: application/json
    Content-Type: application/json; charset=utf-8
    OData-MaxVersion: 4.0
    OData-Version: 4.0
    
  • 回覆

    HTTP/1.1 200 OK
    Content-Type: application/json; odata.metadata=minimal
    OData-Version: 4.0
    
    {
     "@odata.context": "
    [Organization URI]/api/data/v8.0/$metadata#contacts(emailaddress1,lastname,firstname)",
     "value": [
      {
       "@odata.etag": "W/\"504749\"",
       "emailaddress1": null,
       "lastname": "Valdes (sample)",
       "firstname": "Rene",
       "contactid": "8bdd0b31-ed8b-e511-80d2-00155d2a68d4"
      },
      {
       "@odata.etag": "W/\"503647\"",
       "emailaddress1": "someone_l@example.com",
       "lastname": "Burk (sample)",
       "firstname": "Susan",
       "contactid": "91dd0b31-ed8b-e511-80d2-00155d2a68d4"
      }
     ]
    }
    

另請參閱

使用 Microsoft Dynamics 365 Web API
使用 Web API 驗證 Microsoft Dynamics 365
Web API 類型和作業
使用 Web API 執行作業

Microsoft Dynamics 365

© 2017 Microsoft. 著作權所有,並保留一切權利。 著作權