获取图形之外的当前缓存 [英] Get current cache outside of graph
问题描述
我创建了一个自定义选择器,其逻辑取决于屏幕标题部分中的字段值.由于逻辑不在包含视图的图中,我将如何获取此标头部分的缓存的当前值?我已将我在标题中引用的字段设置为 commitchanges=true,我什至将 SyncPosition=true 放在页面的标题部分.以下逻辑没有给我缓存中的当前值(我假设):
I've created a custom selector that has logic which depends on the value of a field in a header section of a screen. Since the logic is not in the graph which holds the views, how would I obtain the current value of the cache for this header section? I've set the field I'm referencing in the header to commitchanges=true and I've even put SyncPosition=true in the header section of the page. The following logic does not give me the current value that is (I'm assuming) in the cache:
mh = (xTACMappingHeader)PXSelect< xTACMappingHeader,
Where< xTACMappingHeader.mappingName, Equal<Required<xTACMappingDetail.mappingName>>>>.Select(new PXGraph<FinancialTranslatorMaint>(), md.MappingName);
在该图形之外的图形中检索缓存当前值的最佳方法是什么?
What's the best way to retrieve the current value of the cache in a graph outside of that graph?
谢谢...
推荐答案
您可以使用 CacheAttached 事件获取图形.请参阅下面的示例.
You get hold of graph using CacheAttached event. See example below.
public class YourAttribute : PXEventSubscriberAttribute
{
private PXGraph _Graph = null;
public override void CacheAttached(PXCache sender)
{
_Graph = sender.Graph;
base.CacheAttached(sender);
}
}
这篇关于获取图形之外的当前缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!