mercredi 9 février 2011

When and How to use Cacheaddmethod

Caching of display methods has been introduced to improve the performance of display and edit functions if they are calculated on the AOS, and to improve the performance when records are transferred from the server to the client.

Cacheaddmethod adds a display method to the cache. Once calculated the result of the method is passed to the client. Only display methods may be cached and only methods on table may be cached.
<formdatasource>.cacheAddMethod(str _methodName [,boolean _updateOnWrite = true])
_methodName
the name of the display method of the table used in this datasource
_updateOnWrite
if true, the content of the cache will be refreshed on record write.
The cache is refreshed on reread and create.
The display method is added to the cache in the init() method of the form datasource. 

void init()
{
    super();
 
    this.cacheAddMethod(tableMethodStr(ProjJournalTrans, ProjName));
}

Happy Daxing!

Aucun commentaire:

Enregistrer un commentaire