yeah it seems like it should work but doesn't for some odd reason. If I call it using the ExecuteStaticQuery it returns all of the rows. (same query name)
The default company does have data, and I've tried adding in the company filter to see if that helps via
query.DataSources[0].Company = "fwm";
query.DataSources[0].DataSources[0].Company = "fwm";
and
AXQueryService.QueryDataRangeMetadata range = new AXQueryService.QueryDataRangeMetadata()
{
Enabled = true,
FieldName = "dataAreaId",
Value = axCompanyName
};
query.DataSources[0].Ranges = new AXQueryService.QueryRangeMetadata[] { range };
query.DataSources[0].DataSources[0].Ranges = new AXQueryService.QueryRangeMetadata[] { range };
(along with just applying it to table1/datasource[0])
But still nothing... I have tried checking the same way via all of the other ways that returns data (dataset.Tables[0].Rows.Count)
also DataTable test = dataSet.Tables["CustTable"]; then test.Rows.Count but that really utilizes the same method. I've also just looked at the properties of dataset while debugging and no counts are anywhere.
I was going thru the results via
//go thru all of the customer results
for (int custCounter = 0; custCounter <= dataSet.Tables[0].Rows.Count - 1; ++custCounter)
{
//get the current customer row
DataRow custRow = dataSet.Tables["CustTable"].Rows[custCounter];
DataRow dirPartyTableRow = dataSet.Tables["DirPartyTable.DirPartyTable"].Rows[custCounter];
AXCustomer axCustomer = new AXCustomer()
{
AccountNum = custRow["AccountNum"].ToString(),
Name = dirPartyTableRow["Name"].ToString()
};
//add the new current customer to the main list
axList.Add(axCustomer);
}
I've also tried adding in the query.ReturnFlatDataSet property to see if that helped but still the same thing.