Я использую экран Обработка, чтобы установить статус выбранной строки. Я использую PXFilteredProcessingJoin и PXFilter, мой основной вид - PXFilter.
Мой делегат фильтра обработки - одиночный, он показывает экран обработки, но после закрытия сетки обработки показывает только обработанные записи, я должен принудительно выполнить refre sh чтобы показать все записи в соответствии с моим фильтром, что мне не хватает, чтобы показать все записи?
/// Constructor
public OrderStatusChangeProcess() {
OrderSampling.SetSelected<RecOrder.selected>();
OrderSampling.SetProcessDelegate(processOrder);
}
public static void processOrder(List<RecOrder> listProcessOrder) {
//here set variable for global error message.
var globalError = false;
//here I have a variable for the po orderNbr nbr to tie to the lines
var orderNbr = string.Empty;
//here I create the graph that will do the processing, can be custom graph also
OrderEntry graph = PXGraph.CreateInstance<OrderEntry>();
//now cycle through the list of records and process each.
foreach(var order in listProcessOrder) {
//here I have a local variable for each line
var lineError = false;
//it is also possible to add transaction support here if only needed for the line item
try {
graph.Clear();
//assign the new receipt nbr for messages
orderNbr = order.OrderCD;
//set the next record to be processed to the current of the graph
graph.Orders.Current = order;
order.Status = "I";
graph.Orders.Update(order);
//then save the results, including the processed flag or condition
graph.Save.Press();
}
//catch any errors that happen in the receipt graph and format the message here, you can
// also write code to a log or record extension to fix the error
catch(Exception e) {
//set line error to true so will skip the process correct below
lineError = true;
//set globaError flag to true to get the global message
globalError = true;
//create a custom error message to post on the grid
var message = "Error Processing Order: " + orderNbr + ": " + e.Message;
}
//create a process complete message and assign to the grid line
var messageTwo = " Order number: " + orderNbr + " Was Processed.";
if(!lineError)
PXFilteredProcessing<RecOrder, OrderFilter>.SetInfo(listProcessOrder.IndexOf(order), messageTwo);
}
//add last create the global error message that displays at the top of the screen
if(globalError)
throw new PXOperationCompletedWithErrorException("At Least One order not Processed.");
}