简体   繁体   English

对数据源 AX2012 的方法使用 cacheAddMethod

[英]Use cacheAddMethod for methods of datasource AX2012

There is a form have two display methods.有一种形式有两种显示方法。 So form load is so slowly.所以表单加载是如此缓慢。 I searched and found this way;我搜索并找到了这种方式;

public void init()
{
    super();
    MyTable_DS.cacheAddMethod(tableMethodStr(MyTable, dispCreditBalance));
}

but my display methods not in table methods node.但我的显示方法不在表格方法节点中。 My methods under form -> datasources -> table -> method node.我在表单 -> 数据源 -> 表 -> 方法节点下的方法。 So tableMethodStr can't see my methods.所以 tableMethodStr 看不到我的方法。

How can use this cacheAddMethod in this situation?在这种情况下如何使用这个 cacheAddMethod ?

Caching of form display methods is not supported.不支持缓存表单显示方法。 You may try to enable the "CacheDateMethod" attribute of the form field, but I expect it will not work.您可以尝试启用表单字段的“CacheDateMethod”属性,但我预计它不会起作用。

If possible (not dependant on form variables) move the display method to the table and remove from the form.如果可能(不依赖于表单变量)将显示方法移动到表格并从表单中删除。

A workaround will be to use a map to store the result and only recompute when needed not found in map.一种解决方法是使用 map 来存储结果,并且仅在 map 中找不到需要时重新计算。 You can see an example in the Pastebin in this answer .您可以在此答案的 Pastebin 中看到一个示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM