Farseer

导航

D365 FO最佳实践BP(五)-Display 方法缓存

为了提高效率AX表上的Display方法可以设置为缓存,在D365FO中如果display方法对应控件的Cache Data Method属性如果没有显式指定为Yes,就会报BP警告。
BPCheckDisplayMethodCached: Display method methodNameon control LineAmount in form FormName not cached
在D365 FO中有两个处理方式,窗体控件级别,Cache Data Method的属性设置为Yes。
表方法上增加属性[SysClientCacheDataMethod]

1 [SysClientCacheDataMethod]
2     public display LineAmount lineAmount()
3     {
4         return CurrencyExchangeHelper::amount(this.Price * this.QtyInstructNow, this.CurrencyCode);
5     }

其实我不太明白AX的用意,既然BP觉得需要缓存Display方法,为什么要让程序员显式指定缓存,直接在编译器层面把Display方法默认为缓存不是更简单吗?

posted on 2020-05-23 16:16  佛西亚  阅读(396)  评论(0编辑  收藏  举报