2
我正嘗試向我的Microsoft Dynamics CRM發送XML SOAP請求。該記錄已創建,但出於某種原因,我的貨幣字段設置爲0.00而不是我提供的值。我用sdk中的SOAPlogger來確保請求是相同的,當我用C#執行時,貨幣字段設置正確,但是當我嘗試用PHP發出請求時,字段設置不正確。使用SOAP端點在Dynamics CRM 2011中創建記錄時,貨幣字段設置爲0.00
以下是正在發送的創建請求。
<Create xmlns="http://schemas.microsoft.com/xrm/2011/Contracts/Services" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<entity xmlns:a="http://schemas.microsoft.com/xrm/2011/Contracts">
<a:Attributes xmlns:b="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
<a:KeyValuePairOfstringanyType>
<b:key>new_invoiceddate</b:key>
<b:value xmlns:c="http://www.w3.org/2001/XMLSchema" i:type="c:dateTime">2014-07-31T00:00:00Z</b:value>
</a:KeyValuePairOfstringanyType>
<a:KeyValuePairOfstringanyType>
<b:key>new_commissiondate</b:key>
<b:value xmlns:c="http://www.w3.org/2001/XMLSchema" i:type="c:dateTime">2014-10-01T00:00:00Z</b:value>
</a:KeyValuePairOfstringanyType>
<a:KeyValuePairOfstringanyType>
<b:key>new_commissionamount</b:key>
<b:value i:type="a:Money">
<a:value>28.08</a:value>
</b:value>
</a:KeyValuePairOfstringanyType>
<a:KeyValuePairOfstringanyType>
<b:key>new_carrier</b:key>
<b:value i:type="a:EntityReference">
<a:Id>9713bd59-5bca-e211-bd6d-001b21a73d70</a:Id>
<a:LogicalName>new_carrier</a:LogicalName>
<a:Name i:nil="true"/>
</b:value>
</a:KeyValuePairOfstringanyType>
<a:KeyValuePairOfstringanyType>
<b:key>new_usagebilled</b:key>
<b:value i:type="a:Money">
<a:value>140.40</a:value>
</b:value>
</a:KeyValuePairOfstringanyType>
<a:KeyValuePairOfstringanyType>
<b:key>new_name</b:key>
<b:value xmlns:c="http://www.w3.org/2001/XMLSchema" i:type="c:string">Action Water Sports - 10/01/2014</b:value>
</a:KeyValuePairOfstringanyType>
<a:KeyValuePairOfstringanyType>
<b:key>new_invoicenumber</b:key>
<b:value xmlns:c="http://www.w3.org/2001/XMLSchema" i:type="c:string">142125103</b:value>
</a:KeyValuePairOfstringanyType>
<a:KeyValuePairOfstringanyType>
<b:key>new_commissiontype</b:key>
<b:value xmlns:c="http://schemas.microsoft.com/xrm/2011/Contracts" i:type="a:OptionSetValue">
<a:Value>100000000</a:Value>
</b:value>
</a:KeyValuePairOfstringanyType>
</a:Attributes>
<a:EntityState i:nil="true"/>
<a:FormattedValues xmlns:b="http://schemas.datacontract.org/2004/07/System.Collections.Generic"/>
<a:Id>00000000-0000-0000-0000-000000000000</a:Id>
<a:LogicalName>new_carriercommission</a:LogicalName>
<a:RelatedEntities xmlns:b="http://schemas.datacontract.org/2004/07/System.Collections.Generic"/>
</entity>
</Create>
嘗試也通過transactioncurrencyid – 2014-11-01 02:15:55
我認爲可能是這樣,但在審計歷史記錄中創建貨幣時看到該幣種正在設置。我繼續前進並添加,但結果仍然相同。謝謝! – Justin 2014-11-01 18:58:31
我檢查了我製作的一個SOAP庫,並且您的代碼相對於貨幣字段是正確的。你有沒有測試另一個實體?只是爲了確保沒有涉及插件或其他東西。另一個區別是,當我創建我不添加標籤與空Guid –
2014-11-02 14:26:00