Вы должны зафиксировать значение фильтра в закрытии делегата. Это шаблон, который я использую для этого:
PXFilter<ProcessFilter> filter;
public void ProcessFilter_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
{
ProcessFilter filter = e.Row as ProcessFilter;
if (filter != null)
{
DataView.SetProcessDelegate(delegate (List<DAC> dacRecords)
{
ExecuteProcess(filter, dacRecords);
});
}
}
public static void ExecuteProcess(ProcessFilter filter, List<DAC> dacRecords)
{
// filter should contain the value captured at closure
// when calling SetProcessDelegate
// You have to create a new graph to process the DAC Records
YourGraph newGraph = PXGraph.CreateInstance<YourGraph>();
foreach (DAC dacRecord in dacRecords)
{
// Use newGraph to modify the records
}
// Save newGraph to persist the changes
}