Re: CRM 3.0 problem with QueryByAttribute and QueryExpression by Arne
Arne
Fri Oct 21 09:38:11 CDT 2005
Hi Gaploid!
Gaploid wrote:
> When i create an object from QueryByAttribute class or QueryExpression
> class and make attribute ColumnSet = new AllColumns(); or ColumnSet =
> my_custom_cols; to my object
> I take an error from mscrm:
> "There is an error in XML document (1, 662). --->
> System.FormatException: Input string was not in a correct format"
Until the public v3 beta, please refer questions to the private beta
newsgroup.
Anyway, you can check if the following code works and if so, what you are
doing different.
// Standard CRM Service Setup
CrmService service = new CrmService();
service.Credentials = System.Net.CredentialCache.DefaultCredentials;
// Create the Query Object
QueryByAttribute query = new QueryByAttribute();
query.ColumnSet = new AllColumns();
query.EntityName = EntityName.account.ToString();
// Query will retrieve all account's whose address1_city is Heidelberg
query.Attributes = new string [] {"address1_city"};
query.Values = new string [] {"Heidelberg"};
// Execute the Retrieval
BusinessEntityCollection retrieved = service.RetrieveMultiple(query);
Cheers
Arne Janning