Hi,
I am attempting to retrieve a SalesOrder record in the SalesTable via the QueryService.
I am able to use ExecuteStaticQuery to return all the rows in the table via the SalesTableSelect query in AOT, but I cannot retrieve a single row using ExecuteQuery method.
Here is my C# code so far:
QueryServiceClient qsc = new QueryServiceClient();
Paging paging = null;
QueryMetadata query = new QueryMetadata();
QueryDataSourceMetadata salesOrderDataSource = new QueryDataSourceMetadata();
DataSet result;
query.Name = "SalesTableQuery";
query.DataSources = new QueryDataSourceMetadata[1];
salesOrderDataSource.Name = "SalesTable DataSource";
salesOrderDataSource.Enabled = true;
salesOrderDataSource.Table = "SalesTable";
salesOrderDataSource.DynamicFieldList = true;
salesOrderDataSource.DynamicFieldListSpecified = true;
query.DataSources[0] = salesOrderDataSource;
query.DataSources[0].Ranges = new QueryRangeMetadata[1];
QueryDataRangeMetadata range = new QueryDataRangeMetadata();
range.FieldName = "SalesId";
range.TableName = "SalesTable";
range.Enabled = true;
range.Value = mySalesId;
query.DataSources[0].Ranges[0] = range;
result = qsc.ExecuteQuery(query, ref paging);
Error: Cannot find table 0
I know the SalesTable exists and I know the record with my SalesId exists.
Thank you for your help.
T. Brooks