English 中文(简体)
AOT 问询时国家
原标题:Circumvent Valid Time State in AOT queries

我在安特遣部队2012年有一个AOT询问,其中包括HcmWorker和HcmEmployment表(以及其他表格)。 我的问题是,当我编写报告(而不是SSRS)或以其他方式使用这种询问时,我只给雇员一个有效的时间。

I would like to get all employees that has a record in this table, even if they doesn t have a current employment - and only once. The optimal solution is to get the record from HcmEmployment for the current employment, if it exists, and otherwise the last record with a start date before "now". However, I can accept a solution where it joins with the last start date.

我更喜欢一种解决办法,即我不需要在我使用时增加代码(即在阿塔查询中解决)。

I have tried setting the validTimeStateDateTimeRange property on the query from code, which resulted in duplicate lines if the employee has several employments.

如果我把HcmEmployment数据来源确定为ExistsJoin,先是,那么,它就是为了一种观点,而不是报告(制造重复记录): 对报告采用这种观点并不是一种选择,因为用户需要能够过滤HcmEmployment的过失。

How can I solve this problem?

最佳回答

I "solved" my own problem...

由于某种原因,报告没有正确继承AOT询问中的财产(ExistsJoin)。 在对报告再次提出疑问之后,在查询中,一些汇编和以下代码在<代码>init<>/code>方法上,该编码可操作: 不再重复记录!

this.query().validTimeStateDateTimeRange(DateTimeUtil::minValue(), 
                                         DateTimeUtil::maxValue());
问题回答

如我所知,你有相互矛盾的选择:

我愿向本表有记录的所有雇员介绍,即使他们目前没有工作。

并且

用户需要能够从HcmEmployment中筛选出来。

如果雇员不选择就业,那么如果用户对就业进行过滤,那么该雇员是否应当进行打印?

你可能希望:

  • 如果不在<代码>上过滤 HcmEmployment , disable that data sources (property Enabled).

  • 如在<代码>上过滤 HcmEmployment 的使用也存在。

在这两种情况下,都由一个独立挑选出最高层(ValidFrom)。

查阅,请查阅,以了解如何按代码对财产进行 que问。

或提出两份报告,一份报告附有,没有查询到<代码>。 HcmEmployment 。





相关问题
Axapta: Programmatically switch records in a form

In Dynamics AX 2009, how do you programmatically change to a different record in a form? My form contains a treeview and a group of bound data fields. When clicking on a record in the tree (the data ...

Dynamics AX 2009 - Duplicate IDs

We are in the process of merging projects from different AX Servers into source control on the same AX server. However, a few object IDs are common between projects, so Dynamics throws an error when ...

How to show a row total amount by group CG Group in Report

I am using Axapta 3.0 with language X++. I am making a report based on available report. The new report only shows a total row by group CG Group instead of showing all detail row as old report. Exam:...

Axapta: Form lifecycle question

I am attempting to manually populate an image icon into a window nested in a grid. In the run event, the fields don t appear to have values yet. The string control always returns an empty value. Is ...

How to reference a report datasource table using x++

I m unable to find the proper syntax for referencing the CustInvoiceTrans table of the SalesInvoice report datasource. Here s the context: I ve created a new classification field on the ...

axapta thread / animation

i have a function which costs plenty of time. this function is an sql-query called via odbc - not written in x++, since the functional range is insufficient. while this operation is running, I want ...

Axapta Validation Class

I ve written a method to handle regex validation in AX2009. Problem is that it always returns false, no matter what the expression or input string. Returns no errors, just false Mind taking a ...

ERP What to read/practice?

I had been learning ERP applications this summer during internship. As I am a programmer about to graduate, I want to have a solid software branch that would get me through till I am sure about what ...

热门标签