Thursday, December 24, 2009

Display caching mechanism

What is display method?

display method is a calculated value that may be calculated via different table fields and classes and on the basis of calculation display method returns a value, it may be used on report and forms.

Disadvantage:
when a display method is called on a form, usually its calling is very frequent to get the calculated value.

Solution:
display caching mechanism provides the way to reduce the calling of its function or call whenever it is necessary...
In the display caching mechanism it is necessary that the method should be on the table level.
In the init method of data source (where the method is written on the table level) on form, display method should be added there by using init datasource.cacheAddMethod & then method name.
for example. emp_ds.cacheAddMethod(methodstr(Emp,displayJobDescription))
emp_ds is datasource and displayJobDescription is the display method.

if we want to call it explicitly on the basis of some modifications of other fields, datasource_cacheCalculatedMethod is used.

a sample code can be downloaded from here.

No comments:

Post a Comment