通常,在所有Acumatica页面中,进行更改时,框架都会向您抛出标准的javascript消息:“所做的更改可能不会保存”,以防止您丢失更改:
或
什么设置导致此行为?我有一个屏幕,那里没有这样的对话框,我也不知道如何引起这种情况。
使用时打开此弹出窗口当使用PXRedirectRequiredException
打开弹出窗口时,不会发生此问题:
throw new PXPopupRedirectException(currentPayCalendarMaint, true, string.Empty);
用PXRedirectRequiredException
打开时:
throw new PXRedirectRequiredException(currentPayCalendarMaint, true, string.Empty);
该框架会在常规浏览器弹出窗口中打开对话框,并按预期方式显示要求的消息(“所做的更改可能不会保存”):
如果不将弹出窗口作为单独的窗口打开,是否有可能具有所要求的行为?
我将感谢您的任何帮助或建议。
我相信在正常情况下,这直接与图形上的IsDirty标志或图形中的缓存相关联。更改任何缓存中的值时,图形的IsDirty标志将设置为true。我已经看到了一些代码,这些代码在特定缓存上手动将IsDirty设置为false,从而导致您所描述的问题。可能发生了这种情况,但是您的代码也可能实际上未更新任何缓存中的任何值。没有您的代码,我只能推测。
来自在PX.Data.PXGraph中定义IsDirty的源代码的注释:
// Summary:
// Gets the value that indicates whether there are modified data records not saved
// to the database in the caches related to the graph data views. If the IsDirty
// property of at least one cache object is true, the IsDirty property of the graph
// is also true.
public virtual bool IsDirty { get; }
摘自SOCreateShipment的摘录,其中使用了Orders的构造函数:
[PXFilterable]
public PXFilteredProcessing<SOOrder, SOOrderFilter> Orders;
...
public virtual IEnumerable orders()
{
PXUIFieldAttribute.SetDisplayName<SOOrder.customerID>(Caches[typeof(SOOrder)], Messages.CustomerID);
...
PXView.StartRow = 0;
Orders.Cache.IsDirty = false;
}