I have an SO Order Entry customization that sets an Acknowledged checkbox true for each SO line during the Action Email Sales Order/quote. public CRActivityList Activity; public PXAction notification; [PXUIField(DisplayName = "Notifications", Visible = false)] [PXButton(ImageKey = PX.Web.UI.Sprite.Main.DataEntryF)] protected virtual IEnumerable Notification(PXAdapter adapter, [PXString] string notificationCD ) { foreach (SOOrder order in adapter.Get()) {
var parameters = new Dictionary<string, string>();
parameters["SOOrder.OrderType"] = order.OrderType;
parameters["SOOrder.OrderNbr"] = order.OrderNbr;
Activity.SendNotification(ARNotificationSource.Customer, notificationCD, order.BranchID, parameters);
foreach (SOLine line in PXSelect<SOLine, Where<SOLine.orderNbr, Equal<Required<SOLine.orderNbr>>>>.Select(Base, order.OrderNbr))
{
SOLineExt rowExt = line.GetExtension<SOLineExt>();
rowExt.UsrAcknowledged = true;
Base.Transactions.Update(line);
//Base.Transactions.View.RequestRefresh();
// SOOrderEntry grp = PXGraph.CreateInstance<SOOrderEntry>();
// grp.Document.Search<SOOrder.orderNbr>(order.OrderNbr, order.OrderType);
}
yield return order;
}
}
Everything works as expected but I have to manually refresh the page to see that the check boxes are checked. Manually refreshing the grid does not display all checks correctly. How can I automatically refresh the page after the process so that it displays correctly?
Try calling in the very end of action delegate:
When post back is received, PXGrid only synchronize current record, not repainting/refreshing other rows.
usually a cache clear works for me but I do not see that you are persisting your change. So a user could cancel your change without saving. If you want to make sure your flag is set and saved for the user you should save the changes and then you can use the cache clear. (however save could refresh the page too)
Try that before the return.
The code snippet below sets an Acknowledged checkbox true for each SO line during the action Email Sales Order/Quote. Unfortunately the Details grid did not automatically refresh due to an issue with ReportProcessor.ProcessReport(Report definition) method corrupting PXLongOperationState and UI thread BLC state. The issue is currently resolved in the latest 6.00.1686 build.
}