簡體   English   中英

ms crm 2011使用javascript檢索報價詳細信息

[英]ms crm 2011 retrieve quote details with javascript

如何通過javascript檢索報價的所有產品(=報價詳細信息)?

我試過下面的代碼,但這不起作用:

id = quoteid
var options = "$select=ProductId&$filter=QuoteId eq (guid'"+ id + "'";
SDK.REST.retrieveMultipleRecords("QuoteDetail", options, ebcont.crm.quote._successQuoteDetailMultiRetrieve, function(error) {alert(error.message);}, ebcont.crm.quote._multiRetrieveQuoteComplete);

我總是收到以下消息:

 Error: 400: Bad Request: operator 'eq' is no compatible with operatortyp 'Microsoft.Crm.Metadata.ComplexTypeInstance'1 ... and 'System.Guid'

有人知道哪里出了問題嗎?

提前致謝!

嘗試將ID添加到QuoteId

id = quoteid
var options = "$select=ProductId&$filter=QuoteId/Id eq (guid'"+ id + "'";
SDK.REST.retrieveMultipleRecords("QuoteDetail", options, ebcont.crm.quote._successQuoteDetailMultiRetrieve, function(error) {alert(error.message);}, ebcont.crm.quote._multiRetrieveQuoteComplete);

這是區分大小寫的,因此請注意這一點。 我建議對XrmToolBox使用FetchXmlBuilder插件,以首先測試REST oData調用。 它具有查看其余URL的選項。 只要您的javascript生成確切的url,您就應該很好。

更新1

對於新的(2016年)CRM WebAPI端點,我還建議Jason Lattimer的CRM Rest Builder: https : //github.com/jlattimer/CRMRESTBuilder/releases

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM