2016-05-19 9 views
0

*customerid*がnullではない請求書のリストを取得しようとしています。私は高度な検索からfetchxmlクエリを生成し、XRMServiceToolkitの関数に入れますが、それは例外をスローします。Fetchxmlが例外でguidのnull値をチェックしていません

例外

Error Code:-2147220989 Message: An exception System.FormatException was thrown while trying to convert input value 'not-null' to attribute 'invoice.customerid'. Expected type of attribute value: System.Guid. Exception raised: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx). 

コードスニペット

は、ここに私のコードスニペットです。

答えて

0

フェッチクエリの行はvar retrievedInvoices = XrmServiceToolkit.Soap.Fetch(query);である必要があります。

+0

私はそれを試しましたが、「オブジェクトがプロパティまたはメソッド 'slice'をサポートしていません」という別の例外がスローされます –

0

このフェッチクエリには、ほとんどのノードで終了タグがありません。これを試してみてください:

<fetch mapping='logical' > 
    <entity name='invoice' > 
    <attribute name='name' /> 
    <attribute name='customerid' /> 
    <attribute name='statuscode' /> 
    <attribute name='totalamount' /> 
    <attribute name='invoiceid' /> 
    <order attribute='name' descending='false' /> 
    <filter type='and' > 
     <condition attribute='customerid' operator='not-null' /> 
    </filter> 
    </entity> 
</fetch> 
関連する問題