如何检索过滤后的记录 [英] How to retrieve the filtered records
问题描述
假设我的交易视图有五行.
Say my Transactions view has five lines.
如果我在数量上设置过滤器以仅显示小于 10 的那些
If I set a filter on Quantity to show only those less than 10
我会这样结束:
我的问题是如何访问这两个记录作为网格中显示的内容?Transactions.Select() 给了我所有/未过滤的五行.我已经实现了视图委托,可以从那里看到过滤后的行.但是它们是否作为缓存对象或其他东西存储在其他地方?
My question is how do I access these two records as what's shown in the grid ? Transactions.Select() gives me all/unfiltered five rows. I've implemented the view delegate and can see the filtered rows from there. But are they stored somewhere else as a cached object or something ?
TIA
推荐答案
下面的示例在 AR 文档发布上创建一个按钮,将所有记录标记为选中,包括已定义的过滤:
The example below creates a button on AR Document Release that marks all records as selected includes filtering that has been defined :
public PXAction<BalancedARDocument> SelectAll;
[PXButton]
[PXUIField(DisplayName = "Select All")]
protected virtual void selectAll()
{
int min = 0;
int totalRows = 0;
foreach (PXResult<BalancedARDocument, ARDocumentRelease.ARInvoice, ARDocumentRelease.ARPayment, Customer, ARAdjust> doc in Base.ARDocumentList.View.Select(null, null, PXView.Searches, Base.ARDocumentList.View.GetExternalSorts(), Base.ARDocumentList.View.GetExternalDescendings(), Base.ARDocumentList.View.GetExternalFilters() ?? new PXFilterRow[0], ref min, 0, ref totalRows))
{
(doc[typeof(BalancedARDocument)] as BalancedARDocument).Selected = true;
Base.ARDocumentList.Update(doc);
}
}
这篇关于如何检索过滤后的记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!