Personalized Community is here!
Quickly customize your community to find the content you seek.
Have questions on moving to the cloud? Visit the Dynamics 365 Migration Community today! Microsoft’s extensive network of Dynamics AX and Dynamics CRM experts can help.
2021 Release Wave 2Discover the latest updates and new features releasing from October 2021 through March 2022.
2021 release wave 2 plan
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Community | FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Upcoming TechTalks | All TechTalks
I try to call the AX QueryService like this example:
But Async from a Windows 8 App.
While executing the Service I got no results.
This is my code in Visual Studio:
public async Task<ObservableCollection<Address>> GetAddress()
ObservableCollection<ANXTMSAddress> ret = new ObservableCollection<Address>();
this.queryClient = new QueryServiceClient();
query = new QueryMetadata();
//Set the Properties of the query
query.QueryType = QueryType.Join;
query.AllowCrossCompany = true;
query.DataSources = new QueryDataSourceMetadata;
//Set the Properties of the address data Source
addressDataSource = new QueryDataSourceMetadata();
addressDataSource.Name = "CustTable";
addressDataSource.Enabled = true;
addressDataSource.FetchMode = FetchMode.OneToOne;
addressDataSource.Table = "CustTable";
//Setting DynamicFieldList property to true returns all fields.
addressDataSource.DynamicFieldList = true;
//Add the data source to the query
query.DataSources = addressDataSource;
AXQueryService.ExecuteQueryRequest req = new ExecuteQueryRequest(query, null);
AXQueryService.ExecuteQueryResponse res = await this.queryClient.ExecuteQueryAsync(req);
List<XElement> list = res.ExecuteQueryResult.Nodes;
ret = Address.FetchDataByQueryService(list, "CustTable");
catch (Exception ex)
I found the Solution in this post:
I had to add These properties:
addressDataSource.EnabledSpecified = true;
addressDataSource.FetchModeSpecified = true;
addressDataSource.DynamicFieldListSpecified = true;
addressDataSource.OrderModeSpecified = true;
And than it works....
Business Applications communities