在过滤网格中标记特定数据集

发布于 2024-09-28 14:00:06 字数 1042 浏览 1 评论 0原文

我只是在以下情况中挣扎 - 在 axapta 2009 中,有一个数据源添加到网格中,并通过 querybuildrange 进行过滤。

我想通过 x++ 标记一个特定的数据集,按

datasource_DS.findrecord( specificRecord )

预期工作,删除过滤器,但不使过滤器处于活动状态! 删除过滤器并将所有内容(已过滤!)首先添加到临时表中的解决方法不是我想要的。

我无法想象没有办法完成这个任务?! 提前致谢!

编辑:

表单上的数据源: - ProdRouteJob(JoinSource:ProdTable,LinkType:InnerJoin) - ProdTable

仅包含指定 ProdStatus 的数据集应显示在网格中。 这是通过提到的范围来完成的,例如:

prodStatusRange =  prodTable_ds.query().dataSourceTable( tablenum( ProdTable )).addRange( fieldnum( ProdTable, ProdStatus ));
prodStatusRange.value( "(( ProdStatus == 0) || ( ProdStatus == 1 ))" );

选择指定的数据集是通过以下方式完成的,例如:

ProdRouteJob currentProdRouteJob;
;
currentProdRouteJob = ProdRouteJob::findJobId( "JOB_12345" );
info ( currentProdRouteJob.JobId );
prodRouteJob_DS.findRecord( currentProdRouteJob );

信息函数显示正确的 JobId。 如果我删除过滤器,findRecord() 选择数据集,如果没有 - 则不会。 添加 DS.research( true ); 不会改变此行为。

i'm just struggling through the following situation -
there's a datasource added to a grid in axapta 2009, filtered by a querybuildrange.

i want to mark a specific dataset by x++ via

datasource_DS.findrecord( specificRecord )

this works as intended, removing the filter, but not having the filter active!
a workaround to remove the filter and add everything ( filtered! )to a temporary table first is not what i want.

i can't imagine there's no way to achieve this task?!
thanks in advance!

edit:

datasources on form:
- ProdRouteJob ( JoinSource: ProdTable, LinkType: InnerJoin )
- ProdTable

only datasets containing a specified ProdStatus should be displayed in the grid.
This is done by the mentioned Range, e.g.:

prodStatusRange =  prodTable_ds.query().dataSourceTable( tablenum( ProdTable )).addRange( fieldnum( ProdTable, ProdStatus ));
prodStatusRange.value( "(( ProdStatus == 0) || ( ProdStatus == 1 ))" );

selecting a specified dataset is done by, e.g.:

ProdRouteJob currentProdRouteJob;
;
currentProdRouteJob = ProdRouteJob::findJobId( "JOB_12345" );
info ( currentProdRouteJob.JobId );
prodRouteJob_DS.findRecord( currentProdRouteJob );

the info-function shows the correct JobId.
if i remove the filter, findRecord() selects the dataset, if not - not.
adding the DS.research( true ); does not change this behaviour.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

骄傲 2024-10-05 14:00:06

您的目标是重新绘制网格并保留所有过滤。

在 AX 2009 中,这很容易:

datasource_DS.research(true);

在 AX 4.0 及更早版本中,您可以研究然后重新查找:

specificRecord = datasource.data();
datasource_DS.research();
datasource_DS.findRecord(specificRecord) 

如果网格中有很多记录,这有时会很慢。

You objective is to redraw the grid and to retain any filtering.

In AX 2009 it is easy:

datasource_DS.research(true);

In AX 4.0 and previous you can research and then refind:

specificRecord = datasource.data();
datasource_DS.research();
datasource_DS.findRecord(specificRecord) 

This can sometimes be slow if there are many records in the grid.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文