通过C#的Dynamics AX 2012 QueryService的示例-关系和JoinMode的用法 [英] Example for Dynamics AX 2012 QueryService through C# - Relations and JoinMode usage

查看:112
本文介绍了通过C#的Dynamics AX 2012 QueryService的示例-关系和JoinMode的用法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试通过c#应用程序访问AX 2012 QueryService,并且仅希望获取CustomerID和Customername字段.问题是,CustomerID在CustTable中,而CustomerName在DirPartyTable中.

Trying to access AX 2012 QueryService through c# application and would like to get CustomerID and Customername fields only. Problem is, CustomerID is in CustTable and CustomerName is in DirPartyTable.

对文章或代码示例的任何帮助将不胜感激.

Any help to article or code samples would be appreciated.

  1. 引用QueryDataSourceMetadata以将联接放入这些表中并获取数据.
  2. 有哪些选项以及何时使用Relations和JoinMode?

我在MSDN中进行了搜索,它仅列出属性名称和方法,而在代码示例形式中并没有太大帮助.

I searched in MSDN and it just lists the property names and methods and not much help in the form of code samples.

推荐答案

据我所知,您将要查询的两个表放入QueryDataSourceMetadata中.结果数据集应包含两个表. (用于创建QueryDataSourceMetadataObject的示例代码在此处: http://msdn.microsoft.com/EN-US/library/gg844682.aspx )

According to my knowledge, you put in the two tables you want to query into your QueryDataSourceMetadata. The resulting dataset should contain both tables. (Example code for creating a QueryDataSourceMetadataObject is here: http://msdn.microsoft.com/EN-US/library/gg844682.aspx)

要连接的表所需的属性是ReturnFlatDataSet. (这可能会有所帮助: http://msdn.microsoft.com/EN-US/library/gg841671.aspx )

The property you need, for the tables to be joined, is ReturnFlatDataSet. (this may help: http://msdn.microsoft.com/EN-US/library/gg841671.aspx)

希望我能为您提供帮助或为您指明正确的方向!

Hope i could help you or point you in the right direction!

这篇关于通过C#的Dynamics AX 2012 QueryService的示例-关系和JoinMode的用法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆